Documentation
¶
Index ¶
- Variables
- func Cert(privateKey any) ([]byte, error)
- func Certify(privateKey any, host string) ([]byte, []byte, error)
- func Exchange(privateKey, publicKey any) ([]byte, error)
- func Register(fn any)
- func Sign(privateKey any, message []byte) ([]byte, error)
- func Verify(publicKey any, message, signature []byte) error
- type PrivateKey
- func (priv *PrivateKey) Bytes() []byte
- func (priv *PrivateKey) Cert() ([]byte, error)
- func (priv *PrivateKey) Certify(host string) ([]byte, []byte, error)
- func (priv *PrivateKey) ED25519() []byte
- func (priv *PrivateKey) Equals(other *PrivateKey) bool
- func (priv *PrivateKey) Exchange(publicKey any) ([]byte, error)
- func (priv *PrivateKey) PEM() []byte
- func (priv *PrivateKey) Public() *PublicKey
- func (priv *PrivateKey) Sign(message []byte) ([]byte, error)
- func (priv *PrivateKey) String() string
- func (priv *PrivateKey) X25519() []byte
- type PublicKey
- func (pub *PublicKey) Bytes() []byte
- func (pub *PublicKey) ED25519() []byte
- func (pub *PublicKey) Equals(other *PublicKey) bool
- func (pub *PublicKey) Exchange(privateKey any) ([]byte, error)
- func (pub *PublicKey) PEM() []byte
- func (pub *PublicKey) String() string
- func (pub *PublicKey) Verify(message []byte, signature []byte) error
- func (pub *PublicKey) X25519() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Organization = "ECC" CertValidity = func() (time.Time, time.Time) { now := time.Now().In(time.UTC) notBefore := time.Date(now.Year()-(now.Year()%10), time.January, 1, 0, 0, 0, 0, time.UTC) notAfter := time.Date(now.Year()-(now.Year()%10)+9, time.December, 31, 23, 59, 59, 0, time.UTC) return notBefore, notAfter } CertifyValidity = func() (time.Time, time.Time) { now := time.Now().In(time.UTC) notBefore := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC) notAfter := time.Date(now.Year(), now.Month(), now.Day(), 23, 59, 59, 0, time.UTC) return notBefore, notAfter } )
View Source
var Base91 = newBase91Encoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_-{|}~'")
Base91 is a binary-to-text encoding scheme with a 91-character alphabet. Of the 95 printable ASCII characters, the following four are omitted: quotation mark (0x22), space (0x20), backtick (0x60) and backslash (0x5c).
Functions ¶
Types ¶
type PrivateKey ¶
type PrivateKey [32]byte
func Private ¶
func Private(privateKey any) (*PrivateKey, error)
func (*PrivateKey) Bytes ¶
func (priv *PrivateKey) Bytes() []byte
func (*PrivateKey) Cert ¶ added in v1.1.0
func (priv *PrivateKey) Cert() ([]byte, error)
func (*PrivateKey) ED25519 ¶ added in v1.1.0
func (priv *PrivateKey) ED25519() []byte
func (*PrivateKey) Equals ¶
func (priv *PrivateKey) Equals(other *PrivateKey) bool
func (*PrivateKey) PEM ¶
func (priv *PrivateKey) PEM() []byte
func (*PrivateKey) Public ¶
func (priv *PrivateKey) Public() *PublicKey
func (*PrivateKey) String ¶
func (priv *PrivateKey) String() string
func (*PrivateKey) X25519 ¶ added in v1.1.0
func (priv *PrivateKey) X25519() []byte
Click to show internal directories.
Click to hide internal directories.