Documentation ¶
Overview ¶
Package signature provides subtle implementations of the PublicKeySign and PublicKeyVerify primitives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EcdsaSign ¶
type EcdsaSign struct {
// contains filtered or unexported fields
}
EcdsaSign is an implementation of PublicKeySign for ECDSA. At the moment, the implementation only accepts DER encoding.
func NewEcdsaSign ¶
func NewEcdsaSign(hashAlg string, curve string, encoding string, keyValue []byte) (*EcdsaSign, error)
NewEcdsaSign creates a new instance of EcdsaSign.
func NewEcdsaSignFromPrivateKey ¶
func NewEcdsaSignFromPrivateKey(hashAlg string, encoding string, privateKey *ecdsa.PrivateKey) (*EcdsaSign, error)
NewEcdsaSignFromPrivateKey creates a new instance of EcdsaSign
type EcdsaSignature ¶
EcdsaSignature is a struct holding r and s values of an ECDSA signature.
func DecodeEcdsaSignature ¶
func DecodeEcdsaSignature(encodedBytes []byte, encoding string) (*EcdsaSignature, error)
DecodeEcdsaSignature creates a new ECDSA signature using the given byte slice. The function assumes that the byte slice is the concatenation of the BigEndian representation of two big integer r and s.
func NewEcdsaSignature ¶
func NewEcdsaSignature(r, s *big.Int) *EcdsaSignature
NewEcdsaSignature creates a new ecdsaSignature object.
func (*EcdsaSignature) EncodeEcdsaSignature ¶
func (sig *EcdsaSignature) EncodeEcdsaSignature(encoding string) ([]byte, error)
EncodeEcdsaSignature converts the signature to the given encoding format. Only DER encoding is supported now.
type EcdsaVerify ¶
type EcdsaVerify struct {
// contains filtered or unexported fields
}
EcdsaVerify is an implementation of PublicKeyVerify for ECDSA. At the moment, the implementation only accepts signatures with strict DER encoding.
func NewEcdsaVerify ¶
func NewEcdsaVerify(hashAlg string, curve string, encoding string, x []byte, y []byte) (*EcdsaVerify, error)
NewEcdsaVerify creates a new instance of EcdsaVerify.
func NewEcdsaVerifyFromPublicKey ¶
func NewEcdsaVerifyFromPublicKey(hashAlg string, encoding string, publicKey *ecdsa.PublicKey) (*EcdsaVerify, error)
NewEcdsaVerifyFromPublicKey creates a new instance of EcdsaVerify.