INNER CODE UNIT · Go
TestVerifyAttestation
go-piv/go-ykpiv · attestation_test.go:180
func TestVerifyAttestation(t *testing.T) {
signedCertificate, err := parseCertificate(signedAttestationCertificateBytes)
if err != nil {
t.Fatalf("could not parse attested certificate %s", err)
}
signingCertificate, err := parseCertificate(attestationSigningCertificateBytes)
if err != nil {
t.Fatalf("could not parse attestation certificate %s", err)
}
chains, err := VerifyAttestation(signingCertificate, signedCertificate)
if err != nil {
t.Fatalf("could not verify attested certificate %s", err)
}
if len(chains) == 0 {
t.Fatalf("expected at least one verified chain to be returned")
}
attestationCertificate, err := NewAttestionCertificate(signedCertificate)
if err != nil {