Versions in this module Expand all Collapse all v1 v1.2.2 Apr 26, 2021 v1.2.1 Apr 20, 2021 Changes in this version + type ErrExportFailed struct + Status string + StatusCode int + func (e ErrExportFailed) Error() string + type ErrPasswordTooShort struct + Min int + Size int + func (e ErrPasswordTooShort) Error() string + type ErrPasswordsDoNotMatch struct + func (e ErrPasswordsDoNotMatch) Error() string + type ErrUnsupportedEncryption struct + Algorithm string + func (e ErrUnsupportedEncryption) Error() string + type ErrUnsupportedPrivateKeyFormat struct + Format string + func (e ErrUnsupportedPrivateKeyFormat) Error() string + type ErrUnsupportedPrivateKeyType struct + Type string + func (e ErrUnsupportedPrivateKeyType) Error() string + type ErrUnsupportedPublicKeyFormat struct + Format string + func (e ErrUnsupportedPublicKeyFormat) Error() string + type ErrUnsupportedPublicKeyType struct + Type string + func (e ErrUnsupportedPublicKeyType) Error() string + type ErrUnsupportedSignature struct + Algorithm string + func (e ErrUnsupportedSignature) Error() string v1.2.0 Apr 19, 2021 Changes in this version + func LoadRSAPrivateKey(directory, name string) (*rsa.PrivateKey, error) + func Password() ([]byte, error) + func RSAPrivateKey(directory, name string, password []byte) (*rsa.PrivateKey, error) v1.1.2 Apr 14, 2021 v1.1.1 Feb 3, 2021 Changes in this version + const AES_128_KEY_SIZE_BITS + const AES_128_KEY_SIZE_BYTES + const AES_256_KEY_SIZE_BITS + const AES_256_KEY_SIZE_BYTES + const ERROR_EXPORT + const ERROR_PASSWORDS_DO_NOT_MATCH + const ERROR_PASSWORD_TOO_SHORT + const ERROR_UNSUPPORTED_ENCRYPTION + const ERROR_UNSUPPORTED_PRIVATE_KEY_FORMAT + const ERROR_UNSUPPORTED_PRIVATE_KEY_TYPE + const ERROR_UNSUPPORTED_PUBLIC_KEY_FORMAT + const ERROR_UNSUPPORTED_PUBLIC_KEY_TYPE + const ERROR_UNSUPPORTED_SIGNATURE + const MIN_PASSWORD + var CompressionAlgorithm_name = map[int32]string + var CompressionAlgorithm_value = map[string]int32 + var EncryptionAlgorithm_name = map[int32]string + var EncryptionAlgorithm_value = map[string]int32 + var PrivateKeyFormat_name = map[int32]string + var PrivateKeyFormat_value = map[string]int32 + var PublicKeyFormat_name = map[int32]string + var PublicKeyFormat_value = map[string]int32 + var SignatureAlgorithm_name = map[int32]string + var SignatureAlgorithm_value = map[string]int32 + func CreateRSAPrivateKey(directory, name string, password []byte) (*rsa.PrivateKey, error) + func CreateSignature(privateKey *rsa.PrivateKey, data []byte, algorithm SignatureAlgorithm) ([]byte, error) + func DecryptAESGCM(key, encrypted []byte) ([]byte, error) + func DecryptKey(algorithm EncryptionAlgorithm, secret []byte, key *rsa.PrivateKey) ([]byte, error) + func DecryptPayload(algorithm EncryptionAlgorithm, key []byte, payload []byte) ([]byte, error) + func EncryptAESGCM(key, payload []byte) ([]byte, error) + func ExportKeys(host, keystore, name string, password []byte) (string, error) + func GenerateRandomKey(bytes int) ([]byte, error) + func GetOrCreateRSAPrivateKey(directory, name string) (*rsa.PrivateKey, error) + func GetPassword() ([]byte, error) + func GetRSAPrivateKey(directory, name string, password []byte) (*rsa.PrivateKey, error) + func HasRSAPrivateKey(directory, name string) bool + func Hash(data []byte) []byte + func HashProtobuf(protobuf proto.Message) ([]byte, error) + func ImportKeys(host, keystore, name, accessCode string) error + func KeyShareHandler(keys KeyShareStore, timeout time.Duration) func(w http.ResponseWriter, r *http.Request) + func ListRSAPrivateKeys(directory string) ([]string, error) + func ParseRSAPrivateKey(privateKey []byte, format PrivateKeyFormat) (*rsa.PrivateKey, error) + func ParseRSAPublicKey(publicKey []byte, format PublicKeyFormat) (*rsa.PublicKey, error) + func PrivateKeyToRSAPrivateKey(key interface{}) (*rsa.PrivateKey, error) + func PublicKeyToRSAPublicKey(key interface{}) (*rsa.PublicKey, error) + func RSAPrivateKeyFromPKCS1Bytes(data []byte) (*rsa.PrivateKey, error) + func RSAPrivateKeyFromPKCS8Bytes(data []byte) (*rsa.PrivateKey, error) + func RSAPrivateKeyToPEM(privateKey *rsa.PrivateKey, password []byte) (*pem.Block, error) + func RSAPrivateKeyToPKCS1Bytes(privateKey *rsa.PrivateKey) []byte + func RSAPrivateKeyToPKCS8Bytes(privateKey *rsa.PrivateKey) ([]byte, error) + func RSAPublicKeyFromPKCS1Bytes(data []byte) (*rsa.PublicKey, error) + func RSAPublicKeyFromPKIXBytes(data []byte) (*rsa.PublicKey, error) + func RSAPublicKeyToPEM(publicKey *rsa.PublicKey) (*pem.Block, error) + func RSAPublicKeyToPKCS1Bytes(publicKey *rsa.PublicKey) []byte + func RSAPublicKeyToPKIXBytes(publicKey *rsa.PublicKey) ([]byte, error) + func RandomString(size uint) (string, error) + func ReadPEM(filename string) (*pem.Block, error) + func ReadPassword(prompt string) ([]byte, error) + func VerifySignature(publicKey *rsa.PublicKey, data, signature []byte, algorithm SignatureAlgorithm) error + func WritePEM(key *pem.Block, filename string) error + func WriteRSAPrivateKey(privateKey *rsa.PrivateKey, directory, name string, password []byte) error + type CompressionAlgorithm int32 + const CompressionAlgorithm_UNKNOWN_COMPRESSION + func (CompressionAlgorithm) EnumDescriptor() ([]byte, []int) + func (x CompressionAlgorithm) String() string + type EncryptionAlgorithm int32 + const EncryptionAlgorithm_AES_128_GCM_NOPADDING + const EncryptionAlgorithm_AES_256_GCM_NOPADDING + const EncryptionAlgorithm_PBKDF2WITHHMACSHA1 + const EncryptionAlgorithm_RSA_ECB_OAEPPADDING + const EncryptionAlgorithm_UNKNOWN_ENCRYPTION + func (EncryptionAlgorithm) EnumDescriptor() ([]byte, []int) + func (x EncryptionAlgorithm) String() string + type KeyShare struct + Name string + Password []byte + PrivateFormat PrivateKeyFormat + PrivateKey []byte + PublicFormat PublicKeyFormat + PublicKey []byte + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*KeyShare) Descriptor() ([]byte, []int) + func (*KeyShare) ProtoMessage() + func (m *KeyShare) GetName() string + func (m *KeyShare) GetPassword() []byte + func (m *KeyShare) GetPrivateFormat() PrivateKeyFormat + func (m *KeyShare) GetPrivateKey() []byte + func (m *KeyShare) GetPublicFormat() PublicKeyFormat + func (m *KeyShare) GetPublicKey() []byte + func (m *KeyShare) Reset() + func (m *KeyShare) String() string + func (m *KeyShare) XXX_DiscardUnknown() + func (m *KeyShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *KeyShare) XXX_Merge(src proto.Message) + func (m *KeyShare) XXX_Size() int + func (m *KeyShare) XXX_Unmarshal(b []byte) error + type KeyShareStore map[string]*KeyShare + type PrivateKeyFormat int32 + const PrivateKeyFormat_PKCS1_PRIVATE + const PrivateKeyFormat_PKCS8 + const PrivateKeyFormat_UNKNOWN_PRIVATE_KEY_FORMAT + func (PrivateKeyFormat) EnumDescriptor() ([]byte, []int) + func (x PrivateKeyFormat) String() string + type PublicKeyFormat int32 + const PublicKeyFormat_PKCS1_PUBLIC + const PublicKeyFormat_PKIX + const PublicKeyFormat_UNKNOWN_PUBLIC_KEY_FORMAT + const PublicKeyFormat_X509 + func (PublicKeyFormat) EnumDescriptor() ([]byte, []int) + func (x PublicKeyFormat) String() string + type SignatureAlgorithm int32 + const SignatureAlgorithm_SHA512WITHRSA + const SignatureAlgorithm_SHA512WITHRSA_PSS + const SignatureAlgorithm_UNKNOWN_SIGNATURE + func (SignatureAlgorithm) EnumDescriptor() ([]byte, []int) + func (x SignatureAlgorithm) String() string