Documentation
¶
Index ¶
- func ConvertPemCertificateChainToX5cFormat(certs []*x509.Certificate) ([]string, error)
- func CreateX509VerifyOptionsFromCertChain(pemChainData ...[]byte) (*x509.VerifyOptions, error)
- func ExtractOptionalWith[T any](claims map[string]any, key string, valueParser func(any) (T, error)) (T, error)
- func GetMapKeys(m map[string]string) []string
- func GetOptional[T any](token jwt.Token, key string) T
- func GetRequestorInfoFromCertificate[T scheme.AttestationProviderRequestor | scheme.RelyingPartyRequestor](cert *x509.Certificate) (*T, error)
- func GetRevocationListsForIssuer(authorityKeyId []byte, issuer pkix.Name, ...) []*x509.RevocationList
- func ObtainIssuerUrlFromCertChain(certChain []*x509.Certificate) (string, error)
- func ParsePemCertificateChain(data []byte) ([]*x509.Certificate, error)
- func ParsePemCertificateChainToX5cFormat(data []byte) ([]string, error)
- func VerifyCertificateAgainstIssuerRevocationLists(cert *x509.Certificate, revocationLists []*x509.RevocationList) error
- func VerifyCertificateUri(cert *x509.Certificate, uri string) error
- func VerifyRevocationListsSignatures(parentCert *x509.Certificate, revocationLists []*x509.RevocationList) error
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPemCertificateChainToX5cFormat ¶
func ConvertPemCertificateChainToX5cFormat(certs []*x509.Certificate) ([]string, error)
func CreateX509VerifyOptionsFromCertChain ¶
func CreateX509VerifyOptionsFromCertChain(pemChainData ...[]byte) (*x509.VerifyOptions, error)
CreateX509VerifyOptionsFromCertChain creates x509.VerifyOptions that can be added to the `VerificationContext` as the trusted certificate chain.
func ExtractOptionalWith ¶
func GetMapKeys ¶
func GetRequestorInfoFromCertificate ¶
func GetRequestorInfoFromCertificate[T scheme.AttestationProviderRequestor | scheme.RelyingPartyRequestor](cert *x509.Certificate) (*T, error)
func GetRevocationListsForIssuer ¶
func GetRevocationListsForIssuer(authorityKeyId []byte, issuer pkix.Name, revocationLists []*x509.RevocationList) []*x509.RevocationList
func ObtainIssuerUrlFromCertChain ¶
func ObtainIssuerUrlFromCertChain(certChain []*x509.Certificate) (string, error)
func ParsePemCertificateChain ¶
func ParsePemCertificateChain(data []byte) ([]*x509.Certificate, error)
ParsePemCertificateChain takes in the raw contents of a PEM formatted certificate file and returns the contents as a list of x509 certificates.
func ParsePemCertificateChainToX5cFormat ¶
ParsePemCertificateChainToX5cFormat takes in the raw contents of a PEM formatted certificate file and returns the contents of the chain in the format expected as the `x5c` header parameter of a jwt.
func VerifyCertificateAgainstIssuerRevocationLists ¶
func VerifyCertificateAgainstIssuerRevocationLists(cert *x509.Certificate, revocationLists []*x509.RevocationList) error
func VerifyCertificateUri ¶
func VerifyCertificateUri(cert *x509.Certificate, uri string) error
func VerifyRevocationListsSignatures ¶
func VerifyRevocationListsSignatures(parentCert *x509.Certificate, revocationLists []*x509.RevocationList) error
VerifyRevocationListsSignatures verifies the signatures of the revocation lists for a given parent certificate. In case of a revocation list for the root certificate, this will verify for the root certificate itself.
Types ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T comparable]() *Set[T]