Search in sources :

Example 6 with EAC2OutputType

use of iso.std.iso_iec._24727.tech.schema.EAC2OutputType in project open-ecard by ecsec.

the class AndroidMarshallerTest method testConversionOfDIDAuthenticateResponseCA.

@Test
public void testConversionOfDIDAuthenticateResponseCA() throws Exception {
    WSMarshaller m = new AndroidMarshaller();
    DIDAuthenticateResponse didAuthResponse = new DIDAuthenticateResponse();
    Result r = new Result();
    r.setResultMajor("major");
    r.setResultMinor("minor");
    InternationalStringType internationalStringType = new InternationalStringType();
    internationalStringType.setLang("en");
    internationalStringType.setValue("message");
    r.setResultMessage(internationalStringType);
    didAuthResponse.setResult(r);
    EAC2OutputType didAuthenticationDataType = new EAC2OutputType();
    didAuthenticationDataType.setProtocol("urn:....");
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document d = builder.newDocument();
    Element e = d.createElementNS("urn:iso:std:iso-iec:24727:tech:schema", "Signature");
    e.setTextContent("7117D7BF95D8D6BD437A0D43DE48F42528273A98F2605758D6A3A2BFC38141E7577CABB4F8FBC8DF152E3A097D1B3A703597331842425FE4A9D0F1C9067AC4A9");
    didAuthenticationDataType.getAny().add(e);
    didAuthResponse.setAuthenticationProtocolData(didAuthenticationDataType);
    marshalLog(didAuthResponse);
    Document doc = m.marshal(didAuthResponse);
    String s = m.doc2str(doc);
    LOG.debug(s);
    StringReader sr = new StringReader(s);
    DIDAuthenticateResponse didaresp = JAXB.unmarshal(sr, DIDAuthenticateResponse.class);
    marshalLog(didaresp);
}
Also used : DIDAuthenticateResponse(iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse) DocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory) DocumentBuilder(javax.xml.parsers.DocumentBuilder) Element(org.w3c.dom.Element) StringReader(java.io.StringReader) WSMarshaller(org.openecard.ws.marshal.WSMarshaller) Document(org.w3c.dom.Document) InternationalStringType(oasis.names.tc.dss._1_0.core.schema.InternationalStringType) Result(oasis.names.tc.dss._1_0.core.schema.Result) EAC2OutputType(iso.std.iso_iec._24727.tech.schema.EAC2OutputType) Test(org.testng.annotations.Test)

Aggregations

DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)6 EAC2OutputType (iso.std.iso_iec._24727.tech.schema.EAC2OutputType)4 InternationalStringType (oasis.names.tc.dss._1_0.core.schema.InternationalStringType)4 Result (oasis.names.tc.dss._1_0.core.schema.Result)4 Document (org.w3c.dom.Document)4 Element (org.w3c.dom.Element)4 InitializeFrameworkResponse (de.bund.bsi.ecard.api._1.InitializeFrameworkResponse)2 StringReader (java.io.StringReader)2 DocumentBuilder (javax.xml.parsers.DocumentBuilder)2 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 DynamicContext (org.openecard.common.DynamicContext)2 ObjectSchemaValidator (org.openecard.common.interfaces.ObjectSchemaValidator)2 ObjectValidatorException (org.openecard.common.interfaces.ObjectValidatorException)2 Promise (org.openecard.common.util.Promise)2 EAC2OutputType (org.openecard.sal.protocol.eac.anytype.EAC2OutputType)2 WSMarshaller (org.openecard.ws.marshal.WSMarshaller)2 Test (org.testng.annotations.Test)2 Version (de.bund.bsi.ecard.api._1.InitializeFrameworkResponse.Version)1 TCTokenType (generated.TCTokenType)1