Search in sources :

Example 11 with InternationalStringType

use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.

the class ECardException method getResult.

public final Result getResult() {
    Result r = new Result();
    r.setResultMajor(getResultMajor());
    r.setResultMinor(getResultMinor());
    InternationalStringType s = new InternationalStringType();
    s.setLang("en");
    s.setValue(getResultMessage());
    r.setResultMessage(s);
    return r;
}
Also used : InternationalStringType(oasis.names.tc.dss._1_0.core.schema.InternationalStringType) Result(oasis.names.tc.dss._1_0.core.schema.Result)

Example 12 with InternationalStringType

use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.

the class AndroidMarshallerTest method testConversionOfInternationalStringType.

@Test
public void testConversionOfInternationalStringType() throws Exception {
    InternationalStringType internationalStringType = new InternationalStringType();
    internationalStringType.setLang("lang");
    internationalStringType.setValue("value");
    WSMarshaller m = new AndroidMarshaller();
    Document d = m.marshal(internationalStringType);
    String s = m.doc2str(d);
    LOG.debug(s);
}
Also used : WSMarshaller(org.openecard.ws.marshal.WSMarshaller) Document(org.w3c.dom.Document) InternationalStringType(oasis.names.tc.dss._1_0.core.schema.InternationalStringType) Test(org.testng.annotations.Test)

Example 13 with InternationalStringType

use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.

the class AndroidMarshallerTest method testConversionOfDIDAuthenticateResponseTA.

@Test
public void testConversionOfDIDAuthenticateResponseTA() 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();
    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", "Challenge");
    e.setTextContent("1331F2B1571E6DC2");
    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)

Example 14 with InternationalStringType

use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.

the class AndroidMarshallerTest method testConversionOfInitializeFrameworkResponse.

@Test
public void testConversionOfInitializeFrameworkResponse() throws Exception {
    InitializeFrameworkResponse initializeFrameworkResponse = new InitializeFrameworkResponse();
    Version version = new Version();
    version.setMajor(new BigInteger("11"));
    version.setMinor(new BigInteger("22"));
    version.setSubMinor(new BigInteger("33"));
    initializeFrameworkResponse.setVersion(version);
    Result r = new Result();
    r.setResultMajor("major");
    r.setResultMinor("minor");
    InternationalStringType internationalStringType = new InternationalStringType();
    internationalStringType.setLang("lang");
    internationalStringType.setValue("value");
    r.setResultMessage(internationalStringType);
    initializeFrameworkResponse.setResult(r);
    marshalLog(initializeFrameworkResponse);
    WSMarshaller m = new AndroidMarshaller();
    Document d = m.marshal(initializeFrameworkResponse);
    String s = m.doc2str(d);
    LOG.debug(s);
}
Also used : Version(de.bund.bsi.ecard.api._1.InitializeFrameworkResponse.Version) InitializeFrameworkResponse(de.bund.bsi.ecard.api._1.InitializeFrameworkResponse) BigInteger(java.math.BigInteger) 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) Test(org.testng.annotations.Test)

Example 15 with InternationalStringType

use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.

the class AndroidMarshallerTest method testConversionOfEstablishChannelResponse.

@Test
public void testConversionOfEstablishChannelResponse() throws Exception {
    EstablishChannelResponse establishChannelResponse = new EstablishChannelResponse();
    Result r = new Result();
    r.setResultMajor("major");
    r.setResultMinor("minor");
    InternationalStringType internationalStringType = new InternationalStringType();
    internationalStringType.setLang("en");
    internationalStringType.setValue("message");
    r.setResultMessage(internationalStringType);
    establishChannelResponse.setResult(r);
}
Also used : EstablishChannelResponse(iso.std.iso_iec._24727.tech.schema.EstablishChannelResponse) InternationalStringType(oasis.names.tc.dss._1_0.core.schema.InternationalStringType) Result(oasis.names.tc.dss._1_0.core.schema.Result) Test(org.testng.annotations.Test)

Aggregations

InternationalStringType (oasis.names.tc.dss._1_0.core.schema.InternationalStringType)17 Result (oasis.names.tc.dss._1_0.core.schema.Result)11 Test (org.testng.annotations.Test)8 Document (org.w3c.dom.Document)8 DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)6 IOException (java.io.IOException)5 Element (org.w3c.dom.Element)5 EAC2OutputType (iso.std.iso_iec._24727.tech.schema.EAC2OutputType)4 WSMarshaller (org.openecard.ws.marshal.WSMarshaller)4 InitializeFrameworkResponse (de.bund.bsi.ecard.api._1.InitializeFrameworkResponse)3 EstablishChannelResponse (iso.std.iso_iec._24727.tech.schema.EstablishChannelResponse)3 LocalizedString (org.openecard.addon.manifest.LocalizedString)3 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)3 BeginTransaction (iso.std.iso_iec._24727.tech.schema.BeginTransaction)2 BeginTransactionResponse (iso.std.iso_iec._24727.tech.schema.BeginTransactionResponse)2 CardApplicationConnect (iso.std.iso_iec._24727.tech.schema.CardApplicationConnect)2 CardApplicationConnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationConnectResponse)2 CardApplicationDisconnect (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnect)2 CardApplicationDisconnectResponse (iso.std.iso_iec._24727.tech.schema.CardApplicationDisconnectResponse)2 CardApplicationPath (iso.std.iso_iec._24727.tech.schema.CardApplicationPath)2