Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RS256 represents a RSA key with SHA-256 signing method RS256 string = "RS256" // RS384 represents a RSA key with SHA-384 signing method RS384 string = "RS384" // RS512 represents a RSA key with SHA-512 signing method RS512 string = "RS512" // PS256 represents a RSA-PSS key with SHA-256 signing method PS256 string = "PS256" // PS384 represents a RSA-PSS key with SHA-384 signing method PS384 string = "PS384" // PS512 represents a RSA-PSS key with SHA-512 signing method PS512 string = "PS512" // ES256 represents an Elliptic Curve with SHA-256 signing method ES256 string = "ES256" // ES384 represents an Elliptic Curve with SHA-384 signing method ES384 string = "ES384" // ES512 represents an Elliptic Curve with SHA-512 signing method ES512 string = "ES512" // EdDSA represents an Edwards Curve signing method EdDSA string = "EdDSA" // KeyTypeRSA represents the RSA key type KeyTypeRSA string = "RSA" // KeyTypeEC represents the EC key type KeyTypeEC string = "EC" // KeyTypeEdDSA represents the EdDSA key type KeyTypeEdDSA string = "EdDSA" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PrivKey ¶
type PrivKey struct { Key interface{} `json:"-" bson:"-"` KeyPem string `json:"key_pem" bson:"key_pem" validate:"required"` Alg string `json:"alg" bson:"alg" validate:"required"` PubKey *PubKey `json:"-" bson:"-"` }
PrivKey represents a private key object including the key and related metadata
func NewPrivKey ¶
NewPrivKey creates a new PrivKey with the provided algorithm and PEM
func (*PrivKey) ComputePubKey ¶
ComputePubKey computes and sets the public key representation corresponding to the private key
type PubKey ¶
type PubKey struct { Key interface{} `json:"-" bson:"-"` KeyPem string `json:"key_pem" bson:"key_pem" validate:"required"` Alg string `json:"alg" bson:"alg" validate:"required"` KeyID string `json:"-" bson:"-"` }
PubKey represents a public key object including the key and related metadata
func (*PubKey) ComputeKeyFingerprint ¶
ComputeKeyFingerprint computes and sets the "KeyID"
Click to show internal directories.
Click to hide internal directories.