INNER CODE UNIT · Go
TestVerifyAttestationWithOptions
go-piv/go-ykpiv · attestation_test.go:214
func TestVerifyAttestationWithOptions(t *testing.T) {
options, err := parseCABundle(customCABytes)
if err != nil {
t.Fatalf("could not parse attestation chain %s", err)
}
signedCertificate, err := parseCertificate(customSignedAttestationCertificateBytes)
if err != nil {
t.Fatalf("could not parse attested certificate %s", err)
}
signingCertificate, err := parseCertificate(customAttestationSigningCertificateBytes)
if err != nil {
t.Fatalf("could not parse attestation certificate %s", err)
}
options.CurrentTime = signedCertificate.NotBefore.Add(1 * time.Second)
chains, err := VerifyAttestationWithOptions(signingCertificate, signedCertificate, options)
if err != nil {
t.Fatalf("could not verify attested certificate %s", err)
}