Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(rand io.Reader, template, parent *x509.Certificate, pub, priv interface{}) ([]byte, error)
Create is a wrapper around x509.CreateCertificate, but it additionally encodes it in base64 so that it can be easily added to `x5c` fields
func EncodeBase64 ¶
EncodeBase64 is a utility function to encode ASN.1 DER certificates using base64 encoding. This operation is normally done by `pem.Encode` but since PEM would include the markers (`-----BEGIN`, and the like) while `x5c` fields do not need this, this function can be used to shave off a few lines
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain represents a certificate chain as used in the `x5c` field of various objects within JOSE.
It stores the certificates as a list of base64 encoded []byte sequence. By definition these values must PKIX encoded.
func (*Chain) Get ¶
Get returns the n-th ASN.1 DER + base64 encoded certificate stored. `false` will be returned in the second argument if the corresponding index is out of range.