use of org.opensaml.xmlsec.signature.KeyName in project verify-hub by alphagov.
the class HubIdentityProviderMetadataDtoToEntityDescriptorTransformerTest method assertCertificateCorrect.
private void assertCertificateCorrect(KeyDescriptor keyDescriptor, String issuerId, Certificate certificateValue) {
final KeyInfo keyInfo = keyDescriptor.getKeyInfo();
final List<KeyName> keyNames = keyInfo.getKeyNames();
Assertions.assertThat(keyNames.size()).isEqualTo(1);
Assertions.assertThat(keyNames.get(0).getValue()).isEqualTo(issuerId);
Assertions.assertThat(keyInfo.getX509Datas().size()).isEqualTo(1);
final List<X509Data> x509Datas = keyInfo.getX509Datas();
final List<X509Certificate> x509Certificates = x509Datas.get(0).getX509Certificates();
Assertions.assertThat(x509Certificates.size()).isEqualTo(1);
Assertions.assertThat(x509Certificates.get(0).getValue()).isEqualTo(certificateValue.getCertificate());
}
Aggregations