Documentation ¶
Index ¶
- Variables
- func GetJwtParametersFromPublicKey(publicKey interface{}) (string, string, string, x509.SignatureAlgorithm, error)
- func GetPrivateKey(privateKeyData []byte) (privateKey interface{}, err error)
- func GetPublicKey(publicKeyData []byte) (publicKey interface{}, err error)
- type Certificate
- type FileOrContent
- type Header
- type HeaderKey
- type JSONWebKey
- type JSONWebKeySet
- type JSONWebToken
- type RawJSONWebKeySet
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedKeyType = errors.New("square/go-jose: unsupported key type/format")
Functions ¶
func GetPrivateKey ¶
func GetPublicKey ¶
Types ¶
type Certificate ¶
type Certificate struct { CertFile FileOrContent `json:"certFile,omitempty" toml:"certFile,omitempty" yaml:"certFile,omitempty"` KeyFile FileOrContent `json:"keyFile,omitempty" toml:"keyFile,omitempty" yaml:"keyFile,omitempty" loggable:"false"` }
Certificate holds a SSL cert/key pair Certs and Key could be either a file path, or the file content itself.
type FileOrContent ¶
type FileOrContent string
func (FileOrContent) IsPath ¶
func (f FileOrContent) IsPath() bool
IsPath returns true if the FileOrContent is a file path, otherwise returns false.
func (FileOrContent) Read ¶
func (f FileOrContent) Read() ([]byte, error)
func (FileOrContent) String ¶
func (f FileOrContent) String() string
type Header ¶
type Header struct { KeyID string JSONWebKey *JSONWebKey Algorithm string Nonce string // Any headers not recognised above get unmarshalled // from JSON in a generic manner and placed in this map. ExtraHeaders map[HeaderKey]interface{} // contains filtered or unexported fields }
Header represents the read-only JOSE header for JWE/JWS objects.
type JSONWebKey ¶
type JSONWebKey struct { // Cryptographic key, can be a symmetric or asymmetric key. Key interface{} // Key identifier, parsed from `kid` header. KeyID string // Key algorithm, parsed from `alg` header. Algorithm string // Key use, parsed from `use` header. Use string // X.509 certificate chain, parsed from `x5c` header. Certificates []*x509.Certificate // X.509 certificate URL, parsed from `x5u` header. CertificatesURL *url.URL // X.509 certificate thumbprint (SHA-1), parsed from `x5t` header. CertificateThumbprintSHA1 []byte // X.509 certificate thumbprint (SHA-256), parsed from `x5t#S256` header. CertificateThumbprintSHA256 []byte }
JSONWebKey represents a public or private key in JWK format.
func (JSONWebKey) MarshalJSON ¶
func (k JSONWebKey) MarshalJSON() ([]byte, error)
MarshalJSON serializes the given key to its JSON representation.
func (*JSONWebKey) UnmarshalJSON ¶
func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error)
func (*JSONWebKey) Valid ¶
func (k *JSONWebKey) Valid() bool
Valid checks that the key contains the expected parameters.
type JSONWebKeySet ¶
type JSONWebKeySet struct {
Keys []JSONWebKey `json:"keys"`
}
func (*JSONWebKeySet) MarshalJSON ¶
func (t *JSONWebKeySet) MarshalJSON() ([]byte, error)
func (*JSONWebKeySet) UnmarshalJSON ¶
func (t *JSONWebKeySet) UnmarshalJSON(b []byte) error
type JSONWebToken ¶
type JSONWebToken struct { Headers []Header // contains filtered or unexported fields }
JSONWebToken represents a JSON Web Token (as specified in RFC7519).
type RawJSONWebKeySet ¶
type RawJSONWebKeySet struct {
Keys []json.RawMessage `json:"keys"`
}
Click to show internal directories.
Click to hide internal directories.