Search in sources :

Example 6 with DefaultX500NameStyleProvider

use of xades4j.providers.impl.DefaultX500NameStyleProvider in project xades4j by luisgoncalves.

the class KeyInfoBuilderTest method testIncludeSubjectName.

@Test
public void testIncludeSubjectName() throws Exception {
    System.out.println("includeSubjectName");
    KeyInfoBuilder keyInfoBuilder = new KeyInfoBuilder(new BasicSignatureOptions().includeSubjectName(true), new SignatureAlgorithms(), new TestAlgorithmsParametersMarshallingProvider(), new DefaultX500NameStyleProvider());
    XMLSignature xmlSignature = getTestSignature();
    keyInfoBuilder.buildKeyInfo(certificates, xmlSignature);
    Assert.assertEquals(1, xmlSignature.getKeyInfo().lengthX509Data());
    Assert.assertEquals(1, xmlSignature.getKeyInfo().itemX509Data(0).lengthSubjectName());
}
Also used : XMLSignature(org.apache.xml.security.signature.XMLSignature) DefaultX500NameStyleProvider(xades4j.providers.impl.DefaultX500NameStyleProvider) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 DefaultX500NameStyleProvider (xades4j.providers.impl.DefaultX500NameStyleProvider)6 XMLSignature (org.apache.xml.security.signature.XMLSignature)5 XMLX509Certificate (org.apache.xml.security.keys.content.x509.XMLX509Certificate)2 X500Principal (javax.security.auth.x500.X500Principal)1 KeyValue (org.apache.xml.security.keys.content.KeyValue)1 SignedInfo (org.apache.xml.security.signature.SignedInfo)1 Node (org.w3c.dom.Node)1 X500NameStyleProvider (xades4j.providers.X500NameStyleProvider)1