Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrVerify alerror.ALSDKError = *alerror.NewAlError("error verifying signature") ErrUnMarshalEC alerror.ALSDKError = *alerror.NewAlError("failed to parse private key") ErrUnknownVersion alerror.ALSDKError = *alerror.NewAlError("unknown EC private key version") ErrInvalidCurveValue alerror.ALSDKError = *alerror.NewAlError("invalid elliptic curve value") ErrInvalidKeyLength alerror.ALSDKError = *alerror.NewAlError("invalid key length") )
Functions ¶
func VerifyUsingECCPem ¶
Types ¶
type ECCKey ¶
type ECCKey struct { PrivateKey *ecdsa.PrivateKey PublicPEM string PrivatePEM string }
func GenerateECC ¶
func (ECCKey) GetKey ¶
func (e ECCKey) GetKey() *ecdsa.PrivateKey
func (ECCKey) GetPrivatePEM ¶
func (ECCKey) GetPublicPEM ¶
type EllipticHandler ¶
type EllipticHandler interface { Sign(Data []byte) (Signature []byte, Hash []byte, SignError error) Verify(Signature []byte, Checksum []byte) (Verified bool) GetPublicPEM() string GetPrivatePEM() string GetKey() *ecdsa.PrivateKey }
func SetECCKey ¶
func SetECCKey(privatePEM string) (EllipticHandler, error)
type RSAHandler ¶
type RSAHandler interface { Sign(Data []byte) (Signature []byte, Hash []byte, SignError error) Verify(Signature []byte, Checksum []byte) (bool, error) GetPublicPEM() string GetPrivatePEM() string GetKey() *rsa.PrivateKey }
func GenerateRSA ¶
func GenerateRSA() (RSAHandler, error)
func SetRSAKey ¶
func SetRSAKey(privatePEM string) (RSAHandler, error)
SetRSAKey - Set the private key by converting its PEM
type RSAKey ¶
type RSAKey struct { PrivateKey *rsa.PrivateKey PublicPEM string PrivatePEM string }
func (RSAKey) GetPrivatePEM ¶
GetPrivatePEM - Return the PEM of the private key
func (RSAKey) GetPublicPEM ¶
GetPublicPEM - Return the PEM of the public key
Click to show internal directories.
Click to hide internal directories.