func (attestationStatement AttestationStatement) UnmarshalCertificates() ([]*x509.Certificate, error) {
	x5c, ok := attestationStatement["x5c"]
	if !ok {
		return nil, ErrMissingCertificate
	}

	x5cs, ok := x5c.([]interface{})
	if !ok {
		return nil, ErrInvalidCertificate
	}

	var certificates []*x509.Certificate
	for _, x5c := range x5cs {
		bs, ok := x5c.([]byte)
		if !ok {
			return nil, ErrInvalidCertificate
		}

		certificate, err := x509.ParseCertificate(bs)
		if err != nil {
			return nil, fmt.Errorf("%w: %s", ErrInvalidCertificate, err)
		}
		certificates = append(certificates, certificate)
	}

	return certificates, nil
}
// UnmarshalCertificates unmarshals X.509 certificates stored in an x5c key.
UnmarshalCertificates unmarshals X.509 certificates stored in an x5c key.
// UnmarshalCertificates unmarshals X . 509 certificates stored in an x5c key .
func (attestationStatement AttestationStatement) UnmarshalCertificates() ([]*x509.Certificate, error) {
	x5c, ok := attestationStatement["x5c"]
	if !ok {
		return nil, ErrMissingCertificate
	}
	x5cs, ok := x5c.([]interface{})
	if !ok {
		return nil, ErrInvalidCertificate
	}
	var certificates []*x509.Certificate
	for _, x5c := range x5cs {
		bs, ok := x5c.([]byte)
		if !ok {
			return nil, ErrInvalidCertificate
		}
		certificate, err := x509.ParseCertificate(bs)
		if err != nil {
			return nil, fmt.Errorf("%w: %s", ErrInvalidCertificate, err)
		}
		certificates = append(certificates, certificate)
	}
	return certificates, nil
}
func ( attestationStatement AttestationStatement ) UnmarshalCertificates ( ) ( [ ] * x509 . Certificate , error ) { x5c , ok := attestationStatement [ " " ] if ! ok { return nil , ErrMissingCertificate } x5cs , ok := x5c . ( [ ] interface { } ) if ! ok { return nil , ErrInvalidCertificate } var certificates [ ] * x509 . Certificate for _ , x5c := range x5cs { bs , ok := x5c . ( [ ] byte ) if ! ok { return nil , ErrInvalidCertificate } certificate , err := x509 . ParseCertificate ( bs ) if err != nil { return nil , fmt . Errorf ( " " , ErrInvalidCertificate , err ) } certificates = append ( certificates , certificate ) } return certificates , nil }
UnmarshalCertificates unmarshals X.509 certificates stored in an x5c key.
UnmarshalCertificates unmarshals X . 509 certificates stored in an x5c key .