Versions in this module Expand all Collapse all v0 v0.6.1 Mar 8, 2020 v0.6.0 Jan 20, 2020 Changes in this version + const COSEAlgES256 + const COSEAlgES384 + const COSEAlgES512 + const COSEAlgPS256 + const COSEAlgPS384 + const COSEAlgPS512 + const COSEAlgRS1 + const COSEAlgRS256 + const COSEAlgRS384 + const COSEAlgRS512 + func RegisterAttestationFormat(name string, parse func([]byte) (AttestationStatement, error)) + func RegisterSignatureAlgorithm(coseAlg int, sigAlg x509.SignatureAlgorithm, pkAlg x509.PublicKeyAlgorithm, ...) + func UnregisterAttestationFormat(name string) + func UnregisterSignatureAlgorithm(coseAlg int) + func VerifyAssertion(credentialAssertion *PublicKeyCredentialAssertion, ...) error + type AssertionExpectedData struct + Challenge string + Credential *Credential + Origin string + PrevCounter uint32 + RPID string + UserCredentialIDs [][]byte + UserID []byte + UserVerification UserVerificationRequirement + type AttestationConveyancePreference string + const AttestationDirect + const AttestationIndirect + const AttestationNone + type AttestationExpectedData struct + Challenge string + CredentialAlgs []int + Origin string + RPID string + UserVerification UserVerificationRequirement + type AttestationStatement interface + Verify func(clientDataHash []byte, authnData *AuthenticatorData) (attType AttestationType, trustPath interface{}, err error) + type AttestationType int + const AttestationTypeBasic + const AttestationTypeCA + const AttestationTypeECDAA + const AttestationTypeNone + const AttestationTypeSelf + func VerifyAttestation(credentialAttestation *PublicKeyCredentialAttestation, ...) (attType AttestationType, trustPath interface{}, err error) + func (attType AttestationType) String() string + type AuthenticatorAttachment string + const AuthenticatorCrossPlatform + const AuthenticatorPlatform + type AuthenticatorData struct + AAGUID []byte + Counter uint32 + Credential *Credential + CredentialID []byte + Extensions map[string]interface{} + RPIDHash []byte + Raw []byte + UserPresent bool + UserVerified bool + type AuthenticatorSelectionCriteria struct + AuthenticatorAttachment AuthenticatorAttachment + RequireResidentKey bool + ResidentKey ResidentKeyRequirement + UserVerification UserVerificationRequirement + type AuthenticatorTransport string + const AuthenticatorBLE + const AuthenticatorInternal + const AuthenticatorNFC + const AuthenticatorUSB + type CollectedClientData struct + Challenge string + Origin string + Raw []byte + TokenBinding *TokenBinding + Type string + type Config struct + Attestation AttestationConveyancePreference + AuthenticatorAttachment AuthenticatorAttachment + ChallengeLength int + CredentialAlgs []int + RPID string + RPIcon string + RPName string + ResidentKey ResidentKeyRequirement + Timeout uint64 + UserVerification UserVerificationRequirement + func (c *Config) Valid() error + type Credential struct + Raw []byte + func ParseCredential(coseKeyData []byte) (c *Credential, rest []byte, err error) + func (c *Credential) MarshalPKIXPublicKeyPEM() ([]byte, error) + func (c *Credential) Verify(message []byte, signature []byte) error + type PublicKeyCredentialAssertion struct + AuthnData *AuthenticatorData + ClientData *CollectedClientData + ID string + RawID []byte + Signature []byte + UserHandle []byte + func ParseAssertion(r io.Reader) (*PublicKeyCredentialAssertion, error) + func (credentialAssertion *PublicKeyCredentialAssertion) UnmarshalJSON(data []byte) (err error) + type PublicKeyCredentialAttestation struct + AttStmt AttestationStatement + AuthnData *AuthenticatorData + ClientData *CollectedClientData + ID string + RawID []byte + func ParseAttestation(r io.Reader) (*PublicKeyCredentialAttestation, error) + func (credentialAttestation *PublicKeyCredentialAttestation) UnmarshalJSON(data []byte) (err error) + func (credentialAttestation *PublicKeyCredentialAttestation) VerifyAttestationStatement() (attType AttestationType, trustPath interface{}, err error) + type PublicKeyCredentialCreationOptions struct + Attestation AttestationConveyancePreference + AuthenticatorSelection AuthenticatorSelectionCriteria + Challenge bufferString + ExcludeCredentials []PublicKeyCredentialDescriptor + PubKeyCredParams []PublicKeyCredentialParameters + RP PublicKeyCredentialRpEntity + Timeout uint64 + User PublicKeyCredentialUserEntity + func NewAttestationOptions(config *Config, user *User) (*PublicKeyCredentialCreationOptions, error) + type PublicKeyCredentialDescriptor struct + ID bufferString + Transports []AuthenticatorTransport + Type PublicKeyCredentialType + type PublicKeyCredentialParameters struct + Alg int + Type PublicKeyCredentialType + type PublicKeyCredentialRequestOptions struct + AllowCredentials []PublicKeyCredentialDescriptor + Challenge bufferString + RPID string + Timeout uint64 + UserVerification UserVerificationRequirement + func NewAssertionOptions(config *Config, user *User) (*PublicKeyCredentialRequestOptions, error) + type PublicKeyCredentialRpEntity struct + ID string + Icon string + Name string + type PublicKeyCredentialType string + const PublicKeyCredentialTypePublicKey + type PublicKeyCredentialUserEntity struct + DisplayName string + ID bufferString + Icon string + Name string + type ResidentKeyRequirement string + const ResidentKeyDiscouraged + const ResidentKeyPreferred + const ResidentKeyRequired + type SignatureAlgorithm struct + Algorithm x509.SignatureAlgorithm + COSEAlgorithm int + Hash crypto.Hash + PublicKeyAlgorithm x509.PublicKeyAlgorithm + func CoseAlgToSignatureAlgorithm(coseAlg int) (SignatureAlgorithm, error) + func (alg SignatureAlgorithm) IsECDSA() bool + func (alg SignatureAlgorithm) IsRSA() bool + func (alg SignatureAlgorithm) IsRSAPSS() bool + type TokenBinding struct + ID string + Status TokenBindingStatus + type TokenBindingStatus string + const TokenBindingPresent + const TokenBindingSupported + type UnmarshalBadDataError struct + Msg string + Type string + func (e *UnmarshalBadDataError) Error() string + type UnmarshalMissingFieldError struct + Field string + Type string + func (e *UnmarshalMissingFieldError) Error() string + type UnmarshalSyntaxError struct + Field string + Msg string + Type string + func (e *UnmarshalSyntaxError) Error() string + type UnregisteredFeatureError struct + Feature string + func (e *UnregisteredFeatureError) Error() string + type UnsupportedFeatureError struct + Feature string + func (e *UnsupportedFeatureError) Error() string + type User struct + CredentialIDs [][]byte + DisplayName string + ID []byte + Icon string + Name string + type UserVerificationRequirement string + const UserVerificationDiscouraged + const UserVerificationPreferred + const UserVerificationRequired + type VerificationError struct + Field string + Msg string + Type string + func (e *VerificationError) Error() string