Add decryptMime and refactor package structure
This commit is contained in:
parent
07b3a2c739
commit
97e70855b8
27 changed files with 516 additions and 486 deletions
16
internal/armor.go
Normal file
16
internal/armor.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"golang.org/x/crypto/openpgp/armor"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func UnArmor(input string) (*armor.Block, error) {
|
||||
io := strings.NewReader(input)
|
||||
b, err := armor.Decode(io)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b, nil
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue