Documentation
¶
Index ¶
- Variables
- func Generate(src []*x509.Certificate, config *GenerateConfig) (*jwa.J509, error)
- func RequestFactoryDefault(ctx context.Context, src *jwa.J509) (*http.Request, error)
- func Verify(ctx context.Context, src *jwa.J509, config *VerifyConfig) ([]*x509.Certificate, error)
- type GenerateConfig
- type VerifyConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCert = errors.New("no certificate chain provided") ErrUnexpectedStatus = errors.New("unexpected status code") )
Functions ¶
func Generate ¶
func Generate(src []*x509.Certificate, config *GenerateConfig) (*jwa.J509, error)
Generate a new X509 JSON payload for a certificate chain.
func RequestFactoryDefault ¶
func Verify ¶
func Verify(ctx context.Context, src *jwa.J509, config *VerifyConfig) ([]*x509.Certificate, error)
Verify ensures the represented certificate chain is valid.
Types ¶
type GenerateConfig ¶
type GenerateConfig struct {
// Embed embeds the certificate chain in the JWT.
Embed bool
// Serve indicates a URL on which certificates will be served.
Serve string
// Thumbprint generates a sha1 thumbprint of the certificate chain.
Thumbprint bool
// Thumbprint256 generates a sha256 thumbprint of the certificate chain.
Thumbprint256 bool
}
type VerifyConfig ¶
type VerifyConfig struct {
// Validate is an optional config to ensure the certificate chain is valid.
Validate *jwx509.ValidateConfig
// ReqFactory is a function to create the request to fetch the remote certificate chain.
//
// While required, you can use the default RequestFactoryDefault for faster setup. This is however not recommended,
// as the URL that serves your certificates must provide a layer of security that should be embedded in that
// request.
ReqFactory func(ctx context.Context, src *jwa.J509) (*http.Request, error)
}
Click to show internal directories.
Click to hide internal directories.