Documentation ¶
Index ¶
- func Hash(data []byte) []byte
- func HashString(data string) []byte
- type EllipticCurve
- func (ec *EllipticCurve) DecodePrivate(pemEncodedPriv string) (*ecdsa.PrivateKey, error)
- func (ec *EllipticCurve) DecodePublic(pemEncodedPub string) (*ecdsa.PublicKey, error)
- func (ec *EllipticCurve) EncodePrivate(privKey *ecdsa.PrivateKey) (string, error)
- func (ec *EllipticCurve) EncodePublic(pubKey *ecdsa.PublicKey) (string, error)
- func (ec *EllipticCurve) GenerateKeys() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func (ec *EllipticCurve) Sign(hash []byte) ([]byte, error)
- func (ec *EllipticCurve) Verify(signature []byte, hash []byte) (bool, error)
- type EncryptionHelper
- type IEncryptionHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashString ¶
Types ¶
type EllipticCurve ¶
type EllipticCurve struct {
// contains filtered or unexported fields
}
func NewEllipticCurve ¶
func NewEllipticCurve(curve elliptic.Curve) *EllipticCurve
func (*EllipticCurve) DecodePrivate ¶
func (ec *EllipticCurve) DecodePrivate(pemEncodedPriv string) (*ecdsa.PrivateKey, error)
func (*EllipticCurve) DecodePublic ¶
func (ec *EllipticCurve) DecodePublic(pemEncodedPub string) (*ecdsa.PublicKey, error)
func (*EllipticCurve) EncodePrivate ¶
func (ec *EllipticCurve) EncodePrivate(privKey *ecdsa.PrivateKey) (string, error)
func (*EllipticCurve) EncodePublic ¶
func (ec *EllipticCurve) EncodePublic(pubKey *ecdsa.PublicKey) (string, error)
func (*EllipticCurve) GenerateKeys ¶
func (ec *EllipticCurve) GenerateKeys() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
type EncryptionHelper ¶
type EncryptionHelper struct {
Key []byte
}
func NewEncryptionHelper ¶
func NewEncryptionHelper(key string) *EncryptionHelper
func (EncryptionHelper) Decrypt ¶
func (eh EncryptionHelper) Decrypt(encryptedData []byte) ([]byte, error)
func (EncryptionHelper) DecryptString ¶
func (eh EncryptionHelper) DecryptString(encryptedData string) ([]byte, error)
func (EncryptionHelper) EncryptString ¶
func (eh EncryptionHelper) EncryptString(data string) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.