Documentation ¶
Index ¶
- func EncodeToString(b []byte) string
- func NewSerialNumber() (*big.Int, error)
- func NewTemplate(subject pkix.Name, ipAddrs, dnsNames []string) (*x509.Certificate, error)
- type Certificate
- func (cert Certificate) E() string
- func (cert Certificate) KeyID() (string, error)
- func (cert Certificate) N() string
- func (cert Certificate) PublicKey() ([]byte, error)
- func (cert Certificate) ToJwk() (Jwk, error)
- func (cert Certificate) ToPem() (string, error)
- func (cert Certificate) X5C() ([]string, error)
- func (cert Certificate) X5T() (string, error)
- type Jwk
- type Jwks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToString ¶
EncodeToString encodes a string to be used in a JWK
func NewSerialNumber ¶
NewSerialNumber returns a new serial number to be used in creating a Certificate
func NewTemplate ¶
NewTemplate returns a new Certificate using default values
Types ¶
type Certificate ¶
type Certificate struct {
// contains filtered or unexported fields
}
Certificate represents a JWK certificate
func NewCertificate ¶
func NewCertificate(cert io.Reader) (Certificate, error)
NewCertificate returns a new Certificate from the given PEM encoded cert
func (Certificate) E ¶
func (cert Certificate) E() string
E returns the encoded exponent part of the RSA public key
func (Certificate) KeyID ¶
func (cert Certificate) KeyID() (string, error)
KeyID returns the key identity of the Certificate's RSA public key
func (Certificate) N ¶
func (cert Certificate) N() string
E returns the encoded modulas part of the RSA public key
func (Certificate) PublicKey ¶
func (cert Certificate) PublicKey() ([]byte, error)
PublicKey returns the Certificate's RSA public key in PEM format
func (Certificate) ToJwk ¶
func (cert Certificate) ToJwk() (Jwk, error)
ToJwk returns the JSON Web Key (JWK) of the certificate
func (Certificate) ToPem ¶
func (cert Certificate) ToPem() (string, error)
ToPem returns the Certificate in PEM format
func (Certificate) X5C ¶
func (cert Certificate) X5C() ([]string, error)
X5C return the x.509 certificate chain in PEM form
func (Certificate) X5T ¶
func (cert Certificate) X5T() (string, error)
X5T returns the encoded SHA-1 sum of the Certificate
type Jwk ¶
type Jwk struct { Alg string `json:"alg"` // Version of cryptographic algorithm KTy string `json:"kty"` // Cryptographic algorithm KID string `json:"kid"` // Key ID Use string `json:"use"` // Use of key N string `json:"n"` // The modulas of the RSA key E string `json:"e"` // The exponent of the RSA key X5C []string `json:"x5c"` // The x.509 certificate chain X5T string `json:"x5t"` // Thumbprint of x.509 cert (SHA-1) }
Jwk represents a JSON Web Key