Documentation
¶
Index ¶
- type EncryptKeyType
- type PublicKeyCrypto
- func NewPublicKeyCrypto(bits int, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
- func NewPublicKeyCryptoWithJWKPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
- func NewPublicKeyCryptoWithPEMPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
- func (ck *PublicKeyCrypto) Decrypt(input string) (string, error)
- func (ck *PublicKeyCrypto) Encrypt(input string) (string, error)
- func (ck *PublicKeyCrypto) GetPrivateKey() ([]byte, error)
- func (ck *PublicKeyCrypto) GetPrivateKeyPKCS8() ([]byte, error)
- func (ck *PublicKeyCrypto) GetPublicKey() ([]byte, error)
- func (ck *PublicKeyCrypto) GetPublicKeyWithJWK() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptKeyType ¶ added in v0.1.1
type EncryptKeyType entity.EncryptKeyType
EncryptKeyType is EncryptKey KeyType
const ( // EncryptTypeRSA is RSA KeyType EncryptTypeRSA EncryptKeyType = EncryptKeyType(entity.EncryptTypeRSA) // EncryptTypeECDSA is ECDSASA KeyType EncryptTypeECDSA EncryptKeyType = EncryptKeyType(entity.EncryptTypeECDSA) // EncryptTypeED25519 is ED25519 KeyType EncryptTypeED25519 EncryptKeyType = EncryptKeyType(entity.EncryptTypeED25519) )
type PublicKeyCrypto ¶
type PublicKeyCrypto struct {
EncryptKey *entity.EncryptKey
// contains filtered or unexported fields
}
PublicKeyCrypto represents PublicKeyCrypto struct
func NewPublicKeyCrypto ¶
func NewPublicKeyCrypto(bits int, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
NewPublicKeyCrypto create PublicKeyCrypto struct
func NewPublicKeyCryptoWithJWKPublicKey ¶
func NewPublicKeyCryptoWithJWKPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
NewPublicKeyCryptoWithJWKPublicKey create PublicKeyCrypto struct with JWK Public Key
func NewPublicKeyCryptoWithPEMPublicKey ¶
func NewPublicKeyCryptoWithPEMPublicKey(publickey []byte, encryptType EncryptKeyType) (*PublicKeyCrypto, error)
NewPublicKeyCryptoWithPEMPublicKey create PublicKeyCrypto struct with PEM Public Key
func (*PublicKeyCrypto) Decrypt ¶
func (ck *PublicKeyCrypto) Decrypt(input string) (string, error)
Decrypt decrypts input data with publickey encryption
func (*PublicKeyCrypto) Encrypt ¶
func (ck *PublicKeyCrypto) Encrypt(input string) (string, error)
Encrypt encrypts input data with publickey encryption
func (*PublicKeyCrypto) GetPrivateKey ¶
func (ck *PublicKeyCrypto) GetPrivateKey() ([]byte, error)
GetPrivateKey gets privatekey
func (*PublicKeyCrypto) GetPrivateKeyPKCS8 ¶
func (ck *PublicKeyCrypto) GetPrivateKeyPKCS8() ([]byte, error)
GetPrivateKeyPKCS8 gets pkcs8 privatekey
func (*PublicKeyCrypto) GetPublicKey ¶
func (ck *PublicKeyCrypto) GetPublicKey() ([]byte, error)
GetPublicKey gets publickey
func (*PublicKeyCrypto) GetPublicKeyWithJWK ¶
func (ck *PublicKeyCrypto) GetPublicKeyWithJWK() ([]byte, error)
GetPublicKeyWithJWK gets jwk publickey
Click to show internal directories.
Click to hide internal directories.