mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-30 14:00:57 +00:00
18 lines
365 B
Go
18 lines
365 B
Go
package internal
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/ProtonMail/go-crypto/openpgp/armor"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// Unarmor unarmors an armored string.
|
|
func Unarmor(input string) (*armor.Block, error) {
|
|
io := strings.NewReader(input)
|
|
b, err := armor.Decode(io)
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "gopenpgp: unable to unarmor")
|
|
}
|
|
return b, nil
|
|
}
|