Documentation ¶
Index ¶
- func EnsureECPrivateKeyHeader(privKey string) string
- func EnsurePrivateKeyHeader(privKey string) string
- func EnsurePublicKeyHeader(pubKey string) string
- type AESBase
- type AESCBC
- type ECC
- func (ec ECC) DecodePrivate(pemEncodedPriv string) (privateKey *ecdsa.PrivateKey, err error)
- func (ec ECC) DecodePublic(pemEncodedPub string) (publicKey *ecdsa.PublicKey, err error)
- func (ec ECC) EncodePrivate(privKey *ecdsa.PrivateKey) (key string, err error)
- func (ec ECC) EncodePublic(pubKey *ecdsa.PublicKey) (key string, err error)
- func (ec ECC) GenerateKey(curve elliptic.Curve) (privKey *ecdsa.PrivateKey, err error)
- func (ec ECC) GenerateKeyPairPem(curve elliptic.Curve) (pubKeyPem string, privKeyPem string, err error)
- func (ec ECC) Sign(privKeyPem string, bs []byte) (signature []byte, err error)
- func (ec ECC) Verify(pubKeyPem string, bs []byte, signature []byte) (bool, error)
- type EDdSA
- type RSA
- func (RSA) GenerateKeyPairPem(bits int) (string, string, error)
- func (RSA) OAEPDecrypt(cipherText string, privKey rsa.PrivateKey) ([]byte, error)
- func (RSA) OAEPEncrypt(secretMessage []byte, key rsa.PublicKey) (string, error)
- func (RSA) ParsePrivateKeyFromPEM(privPEM string) (rsa.PrivateKey, error)
- func (RSA) ParsePublicKeyFromPEM(pubPEM string) (rsa.PublicKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsurePrivateKeyHeader ¶
func EnsurePublicKeyHeader ¶
Types ¶
type AESCBC ¶
type AESCBC struct { AESBase // contains filtered or unexported fields }
func NewAESCBCMd5Key ¶
Symmetric key length must be a multiple of 16
type ECC ¶
type ECC struct { }
Elliptic Curve Cryptography (ECC) is a key-based technique for encrypting data. ECC focuses on pairs of public and private keys for decryption and encryption of web traffic. ECC is frequently discussed in the context of the Rivest–Shamir–Adleman (RSA) cryptographic algorithm. EllipticCurve data struct
func (ECC) DecodePrivate ¶
func (ec ECC) DecodePrivate(pemEncodedPriv string) (privateKey *ecdsa.PrivateKey, err error)
DecodePrivate private key
func (ECC) DecodePublic ¶
DecodePublic public key
func (ECC) EncodePrivate ¶
func (ec ECC) EncodePrivate(privKey *ecdsa.PrivateKey) (key string, err error)
EncodePrivate private key
func (ECC) EncodePublic ¶
EncodePublic public key
func (ECC) GenerateKey ¶
GenerateKeys EllipticCurve public and private keys
func (ECC) GenerateKeyPairPem ¶
type RSA ¶
type RSA struct{}
func (RSA) OAEPDecrypt ¶
func (RSA) OAEPEncrypt ¶
func (RSA) ParsePrivateKeyFromPEM ¶
func (RSA) ParsePrivateKeyFromPEM(privPEM string) (rsa.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.