Documentation ¶
Index ¶
- Constants
- Variables
- func ArmoredEntityReader(armored io.Reader) (*openpgp.Entity, error)
- func DecodeBase64String(message string) []byte
- func DecryptPrivateKey(ent *openpgp.Entity, passphrase string)
- func EncodeBytesToBase64(buf *bytes.Buffer) string
- func GeneratePGPKeyPair(name string, comment string, email string) (crypto.PrivKey, crypto.PubKey, error)
- func PGPPrivUnmarshaller(data []byte) (crypto.PrivKey, error)
- func PGPPubUnmarshaller(data []byte) (crypto.PubKey, error)
- func ReadArmoredPrivateFile(name, passphrase string) (p2pc.PrivKey, error)
- func ReadArmoredPubFile(name string) (p2pc.PubKey, error)
- func ReadPubAndPrivateArmorKeyFile(pub, priv, pass string) (p2pc.PrivKey, p2pc.PubKey)
- func RegisterOpenPGPBinding()
- type PGPPrivateKey
- func (k *PGPPrivateKey) Bytes() ([]byte, error)
- func (k *PGPPrivateKey) DecryptMessage(encString string) (decrypted string, err error)
- func (k *PGPPrivateKey) Equals(key crypto.Key) bool
- func (k *PGPPrivateKey) GetPublic() crypto.PubKey
- func (k *PGPPrivateKey) Raw() ([]byte, error)
- func (k *PGPPrivateKey) Sign(data []byte) ([]byte, error)
- func (k *PGPPrivateKey) Type() pb.KeyType
- type PGPPublicKey
- func (k *PGPPublicKey) Bytes() ([]byte, error)
- func (k *PGPPublicKey) EncryptMessage(secretString string) (encrypted string)
- func (k *PGPPublicKey) Equals(key crypto.Key) bool
- func (k *PGPPublicKey) Raw() ([]byte, error)
- func (k *PGPPublicKey) Type() pb.KeyType
- func (k *PGPPublicKey) Verify(data []byte, sig []byte) (bool, error)
Constants ¶
View Source
const KeyType_OpenPGP = 5
Variables ¶
View Source
var PGPDefaultConf = &packet.Config{ DefaultHash: c.SHA256, }
Functions ¶
func DecodeBase64String ¶
func DecryptPrivateKey ¶
func EncodeBytesToBase64 ¶
func GeneratePGPKeyPair ¶
func ReadArmoredPrivateFile ¶
Open and parse private or public armored file
func ReadArmoredPubFile ¶
Open and parse private or public armored file
func RegisterOpenPGPBinding ¶
func RegisterOpenPGPBinding()
Types ¶
type PGPPrivateKey ¶
type PGPPrivateKey struct {
// contains filtered or unexported fields
}
func (*PGPPrivateKey) Bytes ¶
func (k *PGPPrivateKey) Bytes() ([]byte, error)
func (*PGPPrivateKey) DecryptMessage ¶
func (k *PGPPrivateKey) DecryptMessage(encString string) (decrypted string, err error)
func (*PGPPrivateKey) GetPublic ¶
func (k *PGPPrivateKey) GetPublic() crypto.PubKey
func (*PGPPrivateKey) Raw ¶
func (k *PGPPrivateKey) Raw() ([]byte, error)
func (*PGPPrivateKey) Type ¶
func (k *PGPPrivateKey) Type() pb.KeyType
type PGPPublicKey ¶
Ed25519PublicKey is an ed25519 public pair.
func (*PGPPublicKey) Bytes ¶
func (k *PGPPublicKey) Bytes() ([]byte, error)
func (*PGPPublicKey) EncryptMessage ¶
func (k *PGPPublicKey) EncryptMessage(secretString string) (encrypted string)
if outEncryptedFile file is not nil, the file will also be stored return the string value
func (*PGPPublicKey) Raw ¶
func (k *PGPPublicKey) Raw() ([]byte, error)
func (*PGPPublicKey) Type ¶
func (k *PGPPublicKey) Type() pb.KeyType
Click to show internal directories.
Click to hide internal directories.