Versions in this module Expand all Collapse all v0 v0.1.0 Nov 11, 2025 Changes in this version + const ECDSA_P256_TYPE + const ECDSA_TYPE + const ED25519_TYPE + const INVALID_TYPE + const KeySchemeECDSA_SHA2_P256 + const KeySchemeECDSA_SHA2_P384 + const KeySchemeEd25519 + const KeySchemeRSASSA_PSS_SHA256 + const KeyTypeECDSA_SHA2_P256 + const KeyTypeECDSA_SHA2_P256_COMPAT + const KeyTypeEd25519 + const KeyTypeRSASSA_PSS_SHA256 + const RSAKeyLength + const RSA_TYPE + var CryptoInfoList = []CryptoInfo + var ErrorEmptyKey = errors.New("error on key empty, check if the key has been initialized") + var ErrorUnsupportedKeyType = errors.New("provided key type not supported") + var InvalidCryptoInvalid = "INVALID" + func CryptoSchemaList(splite string) string + func CryptoShortList(splite string) string + func CryptoTypeList(splite string) string + func GenKeyPair(ty CryptoType, privatePath, publicPath string) error + func LoadKeyInfo(info *KeyInfo) (PrivateKey, PublicKey, error) + func LoadKeyInfoFile(filePath string) (PrivateKey, PublicKey, error) + func ShowKeyInfo(ki *KeyInfo) error + func ShowKeyInfoFile(dst string) error + type CryptoInfo struct + Schema string + Short string + Type string + type CryptoType int + func (l *CryptoType) Set(value string) error + func (l *CryptoType) SetInt(value int) error + func (l *CryptoType) SetScheme(value string) error + func (l *CryptoType) SetShort(value string) error + func (l *CryptoType) String() string + func (l CryptoType) Boolean() bool + func (l CryptoType) Schema() string + func (l CryptoType) Short() string + func (l CryptoType) Type() string + type Ed25519PrivKey struct + func (p *Ed25519PrivKey) Empty() bool + func (p *Ed25519PrivKey) Generate() error + func (p *Ed25519PrivKey) Key() crypto.PrivateKey + func (p *Ed25519PrivKey) KeyInfo() (*KeyInfo, error) + func (p *Ed25519PrivKey) ParsePem(key []byte) error + func (p *Ed25519PrivKey) Pem() ([]byte, error) + func (p *Ed25519PrivKey) Public() PublicKey + func (p *Ed25519PrivKey) SetKey(k crypto.PrivateKey) error + func (p *Ed25519PrivKey) Signer() crypto.Signer + func (p *Ed25519PrivKey) Type() CryptoType + type Ed25519PubKey struct + func (p *Ed25519PubKey) Empty() bool + func (p *Ed25519PubKey) Key() crypto.PublicKey + func (p *Ed25519PubKey) KeyInfo() (*KeyInfo, error) + func (p *Ed25519PubKey) ParsePem(key []byte) error + func (p *Ed25519PubKey) Pem() ([]byte, error) + func (p *Ed25519PubKey) SetKey(k crypto.PublicKey) error + func (p *Ed25519PubKey) Type() CryptoType + type KeyInfo struct + Scheme string + Type string + Value map[string]string + func NewKeyInfo() *KeyInfo + func (ki *KeyInfo) CheckType() (CryptoType, error) + func (ki *KeyInfo) Empty() bool + func (ki *KeyInfo) ID() (string, error) + func (ki *KeyInfo) IsPrivate() bool + func (ki *KeyInfo) IsPublic() bool + func (ki *KeyInfo) Load(src string) error + func (ki *KeyInfo) PrivData() (string, error) + func (ki *KeyInfo) PubData() (string, error) + func (ki *KeyInfo) Save(dst string, privMode os.FileMode) error + type PrivateKey interface + Empty func() bool + Generate func() error + Key func() crypto.PrivateKey + KeyInfo func() (*KeyInfo, error) + ParsePem func([]byte) error + Pem func() ([]byte, error) + Public func() PublicKey + SetKey func(crypto.PrivateKey) error + Signer func() crypto.Signer + Type func() CryptoType + func NewEd25519PrivKey() PrivateKey + func NewPrivateKey(ty CryptoType) (PrivateKey, error) + func NewRSAPrivKey() PrivateKey + type PublicKey interface + Key func() crypto.PublicKey + KeyInfo func() (*KeyInfo, error) + ParsePem func([]byte) error + Pem func() ([]byte, error) + SetKey func(crypto.PublicKey) error + Type func() CryptoType + func NewEd25519PubKey() PublicKey + func NewPublicKey(ty CryptoType) (PublicKey, error) + func NewRSAPublicKey() PublicKey + type RSAPrivKey struct + func (p *RSAPrivKey) Empty() bool + func (p *RSAPrivKey) Generate() error + func (p *RSAPrivKey) Key() crypto.PrivateKey + func (p *RSAPrivKey) KeyInfo() (*KeyInfo, error) + func (p *RSAPrivKey) ParsePem(key []byte) error + func (p *RSAPrivKey) Pem() ([]byte, error) + func (p *RSAPrivKey) Public() PublicKey + func (p *RSAPrivKey) SetKey(k crypto.PrivateKey) error + func (p *RSAPrivKey) Signer() crypto.Signer + func (p *RSAPrivKey) Type() CryptoType + type RSAPubKey struct + func (p *RSAPubKey) Empty() bool + func (p *RSAPubKey) Key() crypto.PublicKey + func (p *RSAPubKey) KeyInfo() (*KeyInfo, error) + func (p *RSAPubKey) ParsePem(key []byte) error + func (p *RSAPubKey) Pem() ([]byte, error) + func (p *RSAPubKey) SetKey(k crypto.PublicKey) error + func (p *RSAPubKey) Type() CryptoType