Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StandardCurve is the curve we use for all elliptic curve // operations. StandardCurve = elliptic.P256() )
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct { ID []byte EncryptionPrivateKey *ecdsa.PrivateKey EncryptionPublicKey *ecdsa.PublicKey HandshakePrivateKey *ecdsa.PrivateKey HandshakePublicKey *ecdsa.PublicKey }
Certificate describes the information that identifies each unique user of STL. Certificates should be validated externally.
func GenerateCertificate ¶
func GenerateCertificate(rand io.Reader) (*Certificate, error)
GenerateCertificate generates a random certificate. The certificate still needs an ID field which should be produced by an external entity.
func UnmarshalCertificate ¶
func UnmarshalCertificate(b []byte) (*Certificate, error)
UnmarshalCertificate parses out a certificate from a slice of bytes.
func (*Certificate) Equal ¶
func (c *Certificate) Equal(c2 *Certificate) bool
Equal checks whether two certificates are equal. Equal only checks public key parameters.
func (*Certificate) Marshal ¶
func (c *Certificate) Marshal() ([]byte, error)
Marshal marshals a certificate into bytes.
func (*Certificate) Validate ¶
func (c *Certificate) Validate() error
Validate validates a certificate
Click to show internal directories.
Click to hide internal directories.