Documentation ¶
Overview ¶
Package crypt is a wrapper around standard and 3rd party signature algorithms which adds a support of Tezos encodings of keys and signatures
Index ¶
- Variables
- type BLSPrivateKey
- func (priv *BLSPrivateKey) Equal(other PrivateKey) bool
- func (priv *BLSPrivateKey) MarshalText() (text []byte, err error)
- func (priv *BLSPrivateKey) Public() PublicKey
- func (priv *BLSPrivateKey) Sign(message []byte) (signature Signature, err error)
- func (priv *BLSPrivateKey) String() string
- func (priv *BLSPrivateKey) ToBase58() []byte
- func (priv *BLSPrivateKey) ToProtocol() tz.PrivateKey
- func (priv *BLSPrivateKey) Unwrap() crypto.PrivateKey
- type BLSPublicKey
- func (pub *BLSPublicKey) Equal(other PublicKey) bool
- func (pub *BLSPublicKey) Hash() PublicKeyHash
- func (pub *BLSPublicKey) MarshalText() (text []byte, err error)
- func (pub *BLSPublicKey) String() string
- func (pub *BLSPublicKey) ToBase58() []byte
- func (pub *BLSPublicKey) ToProtocol() tz.PublicKey
- func (pub *BLSPublicKey) Unwrap() crypto.PublicKey
- func (pub *BLSPublicKey) VerifySignature(sig Signature, message []byte) bool
- type BLSSignature
- type Digest
- type ECDSAPrivateKey
- func (priv *ECDSAPrivateKey) Equal(other PrivateKey) bool
- func (priv *ECDSAPrivateKey) MarshalText() (text []byte, err error)
- func (priv *ECDSAPrivateKey) Public() PublicKey
- func (priv *ECDSAPrivateKey) Sign(message []byte) (signature Signature, err error)
- func (priv *ECDSAPrivateKey) String() string
- func (priv *ECDSAPrivateKey) ToBase58() []byte
- func (priv *ECDSAPrivateKey) ToProtocol() tz.PrivateKey
- func (priv *ECDSAPrivateKey) Unwrap() crypto.PrivateKey
- type ECDSAPublicKey
- func (pub *ECDSAPublicKey) Equal(other PublicKey) bool
- func (pub *ECDSAPublicKey) Hash() PublicKeyHash
- func (pub *ECDSAPublicKey) MarshalText() (text []byte, err error)
- func (pub *ECDSAPublicKey) String() string
- func (pub *ECDSAPublicKey) ToBase58() []byte
- func (pub *ECDSAPublicKey) ToProtocol() tz.PublicKey
- func (pub *ECDSAPublicKey) Unwrap() crypto.PublicKey
- func (pub *ECDSAPublicKey) VerifySignature(sig Signature, message []byte) bool
- type ECDSASignature
- type Ed25519PrivateKey
- func (priv Ed25519PrivateKey) Equal(other PrivateKey) bool
- func (priv Ed25519PrivateKey) MarshalText() (text []byte, err error)
- func (priv Ed25519PrivateKey) Public() PublicKey
- func (priv Ed25519PrivateKey) Seed() []byte
- func (priv Ed25519PrivateKey) Sign(message []byte) (signature Signature, err error)
- func (priv Ed25519PrivateKey) String() string
- func (priv Ed25519PrivateKey) ToBase58() []byte
- func (priv Ed25519PrivateKey) ToProtocol() tz.PrivateKey
- func (priv Ed25519PrivateKey) Unwrap() crypto.PrivateKey
- type Ed25519PublicKey
- func (pub Ed25519PublicKey) Equal(other PublicKey) bool
- func (pub Ed25519PublicKey) Hash() PublicKeyHash
- func (pub Ed25519PublicKey) MarshalText() (text []byte, err error)
- func (pub Ed25519PublicKey) String() string
- func (pub Ed25519PublicKey) ToBase58() []byte
- func (pub Ed25519PublicKey) ToProtocol() tz.PublicKey
- func (pub Ed25519PublicKey) Unwrap() crypto.PublicKey
- func (pub Ed25519PublicKey) VerifySignature(sig Signature, message []byte) bool
- type Ed25519Signature
- type GenericSignature
- type PrivateKey
- type PublicKey
- type PublicKeyHash
- type Signature
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BLSPrivateKey ¶
type BLSPrivateKey minpk.PrivateKey
func (*BLSPrivateKey) Equal ¶
func (priv *BLSPrivateKey) Equal(other PrivateKey) bool
func (*BLSPrivateKey) MarshalText ¶
func (priv *BLSPrivateKey) MarshalText() (text []byte, err error)
func (*BLSPrivateKey) Public ¶
func (priv *BLSPrivateKey) Public() PublicKey
func (*BLSPrivateKey) Sign ¶
func (priv *BLSPrivateKey) Sign(message []byte) (signature Signature, err error)
func (*BLSPrivateKey) String ¶
func (priv *BLSPrivateKey) String() string
func (*BLSPrivateKey) ToBase58 ¶
func (priv *BLSPrivateKey) ToBase58() []byte
func (*BLSPrivateKey) ToProtocol ¶
func (priv *BLSPrivateKey) ToProtocol() tz.PrivateKey
func (*BLSPrivateKey) Unwrap ¶
func (priv *BLSPrivateKey) Unwrap() crypto.PrivateKey
type BLSPublicKey ¶
func (*BLSPublicKey) Equal ¶
func (pub *BLSPublicKey) Equal(other PublicKey) bool
func (*BLSPublicKey) Hash ¶
func (pub *BLSPublicKey) Hash() PublicKeyHash
func (*BLSPublicKey) MarshalText ¶
func (pub *BLSPublicKey) MarshalText() (text []byte, err error)
func (*BLSPublicKey) String ¶
func (pub *BLSPublicKey) String() string
func (*BLSPublicKey) ToBase58 ¶
func (pub *BLSPublicKey) ToBase58() []byte
func (*BLSPublicKey) ToProtocol ¶
func (pub *BLSPublicKey) ToProtocol() tz.PublicKey
func (*BLSPublicKey) Unwrap ¶
func (pub *BLSPublicKey) Unwrap() crypto.PublicKey
func (*BLSPublicKey) VerifySignature ¶
func (pub *BLSPublicKey) VerifySignature(sig Signature, message []byte) bool
type BLSSignature ¶
func (*BLSSignature) MarshalText ¶
func (sig *BLSSignature) MarshalText() (text []byte, err error)
func (*BLSSignature) String ¶
func (sig *BLSSignature) String() string
func (*BLSSignature) ToBase58 ¶
func (sig *BLSSignature) ToBase58() []byte
func (*BLSSignature) ToProtocol ¶
func (sig *BLSSignature) ToProtocol() tz.Signature
type ECDSAPrivateKey ¶
type ECDSAPrivateKey ecdsa.PrivateKey
func (*ECDSAPrivateKey) Equal ¶
func (priv *ECDSAPrivateKey) Equal(other PrivateKey) bool
func (*ECDSAPrivateKey) MarshalText ¶
func (priv *ECDSAPrivateKey) MarshalText() (text []byte, err error)
func (*ECDSAPrivateKey) Public ¶
func (priv *ECDSAPrivateKey) Public() PublicKey
func (*ECDSAPrivateKey) Sign ¶
func (priv *ECDSAPrivateKey) Sign(message []byte) (signature Signature, err error)
func (*ECDSAPrivateKey) String ¶
func (priv *ECDSAPrivateKey) String() string
func (*ECDSAPrivateKey) ToBase58 ¶
func (priv *ECDSAPrivateKey) ToBase58() []byte
func (*ECDSAPrivateKey) ToProtocol ¶
func (priv *ECDSAPrivateKey) ToProtocol() tz.PrivateKey
func (*ECDSAPrivateKey) Unwrap ¶
func (priv *ECDSAPrivateKey) Unwrap() crypto.PrivateKey
type ECDSAPublicKey ¶
func (*ECDSAPublicKey) Equal ¶
func (pub *ECDSAPublicKey) Equal(other PublicKey) bool
func (*ECDSAPublicKey) Hash ¶
func (pub *ECDSAPublicKey) Hash() PublicKeyHash
func (*ECDSAPublicKey) MarshalText ¶
func (pub *ECDSAPublicKey) MarshalText() (text []byte, err error)
func (*ECDSAPublicKey) String ¶
func (pub *ECDSAPublicKey) String() string
func (*ECDSAPublicKey) ToBase58 ¶
func (pub *ECDSAPublicKey) ToBase58() []byte
func (*ECDSAPublicKey) ToProtocol ¶
func (pub *ECDSAPublicKey) ToProtocol() tz.PublicKey
func (*ECDSAPublicKey) Unwrap ¶
func (pub *ECDSAPublicKey) Unwrap() crypto.PublicKey
func (*ECDSAPublicKey) VerifySignature ¶
func (pub *ECDSAPublicKey) VerifySignature(sig Signature, message []byte) bool
type ECDSASignature ¶
func (*ECDSASignature) MarshalText ¶
func (sig *ECDSASignature) MarshalText() (text []byte, err error)
func (*ECDSASignature) String ¶
func (sig *ECDSASignature) String() string
func (*ECDSASignature) ToBase58 ¶
func (sig *ECDSASignature) ToBase58() []byte
func (*ECDSASignature) ToProtocol ¶
func (sig *ECDSASignature) ToProtocol() tz.Signature
type Ed25519PrivateKey ¶
type Ed25519PrivateKey ed25519.PrivateKey
func (Ed25519PrivateKey) Equal ¶
func (priv Ed25519PrivateKey) Equal(other PrivateKey) bool
func (Ed25519PrivateKey) MarshalText ¶
func (priv Ed25519PrivateKey) MarshalText() (text []byte, err error)
func (Ed25519PrivateKey) Public ¶
func (priv Ed25519PrivateKey) Public() PublicKey
func (Ed25519PrivateKey) Seed ¶
func (priv Ed25519PrivateKey) Seed() []byte
func (Ed25519PrivateKey) Sign ¶
func (priv Ed25519PrivateKey) Sign(message []byte) (signature Signature, err error)
func (Ed25519PrivateKey) String ¶
func (priv Ed25519PrivateKey) String() string
func (Ed25519PrivateKey) ToBase58 ¶
func (priv Ed25519PrivateKey) ToBase58() []byte
func (Ed25519PrivateKey) ToProtocol ¶
func (priv Ed25519PrivateKey) ToProtocol() tz.PrivateKey
func (Ed25519PrivateKey) Unwrap ¶
func (priv Ed25519PrivateKey) Unwrap() crypto.PrivateKey
type Ed25519PublicKey ¶
func (Ed25519PublicKey) Equal ¶
func (pub Ed25519PublicKey) Equal(other PublicKey) bool
func (Ed25519PublicKey) Hash ¶
func (pub Ed25519PublicKey) Hash() PublicKeyHash
func (Ed25519PublicKey) MarshalText ¶
func (pub Ed25519PublicKey) MarshalText() (text []byte, err error)
func (Ed25519PublicKey) String ¶
func (pub Ed25519PublicKey) String() string
func (Ed25519PublicKey) ToBase58 ¶
func (pub Ed25519PublicKey) ToBase58() []byte
func (Ed25519PublicKey) ToProtocol ¶
func (pub Ed25519PublicKey) ToProtocol() tz.PublicKey
func (Ed25519PublicKey) Unwrap ¶
func (pub Ed25519PublicKey) Unwrap() crypto.PublicKey
func (Ed25519PublicKey) VerifySignature ¶
func (pub Ed25519PublicKey) VerifySignature(sig Signature, message []byte) bool
type Ed25519Signature ¶
type Ed25519Signature []byte
func NewEd25519Signature ¶
func NewEd25519Signature(sig *tz.Ed25519Signature) Ed25519Signature
func (Ed25519Signature) MarshalText ¶
func (sig Ed25519Signature) MarshalText() (text []byte, err error)
func (Ed25519Signature) String ¶
func (sig Ed25519Signature) String() string
func (Ed25519Signature) ToBase58 ¶
func (sig Ed25519Signature) ToBase58() []byte
func (Ed25519Signature) ToProtocol ¶
func (sig Ed25519Signature) ToProtocol() tz.Signature
type GenericSignature ¶
type GenericSignature tz.GenericSignature
func (*GenericSignature) String ¶
func (sig *GenericSignature) String() string
func (*GenericSignature) ToBase58 ¶
func (sig *GenericSignature) ToBase58() []byte
func (*GenericSignature) ToProtocol ¶
func (sig *GenericSignature) ToProtocol() tz.Signature
type PrivateKey ¶
type PrivateKey interface { tz.Base58Encoder ToProtocol() tz.PrivateKey Sign(message []byte) (signature Signature, err error) Public() PublicKey Equal(PrivateKey) bool Unwrap() crypto.PrivateKey }
func NewPrivateKey ¶
func NewPrivateKey(priv tz.PrivateKey) (PrivateKey, error)
func NewPrivateKeyFrom ¶
func NewPrivateKeyFrom(priv crypto.PrivateKey) (PrivateKey, error)
NewPrivateKeyFrom tries to make PrivateKey from a raw one. It returns ErrUnsupportedKeyType if the key is of unsupported type
func ParsePrivateKey ¶
func ParsePrivateKey(src []byte) (PrivateKey, error)
type PublicKey ¶
type PublicKey interface { tz.Base58Encoder ToProtocol() tz.PublicKey VerifySignature(sig Signature, message []byte) bool Hash() PublicKeyHash Equal(PublicKey) bool Unwrap() crypto.PublicKey }
func NewPublicKeyFrom ¶
NewPublicKeyFrom tries to make PublicKey from a raw one. It returns ErrUnsupportedKeyType if the key is of unsupported type
func ParsePublicKey ¶
type PublicKeyHash ¶
type PublicKeyHash = tz.PublicKeyHash
type Signature ¶
type Signature interface { tz.Base58Encoder ToProtocol() tz.Signature Verify(pub PublicKey, message []byte) bool }
func NewSignatureFromBytes ¶
NewSignatureFromBytes tries to parse signature coming from a third party. It makes an assumption about signature type base on the public key. For ECDSA it expects the signature to be serialized to ASN.1
func ParseSignature ¶
Click to show internal directories.
Click to hide internal directories.