Search in sources :

Example 1 with SignaturePubKeyOrderDataType

use of com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createSignaturePubKeyOrderData.

/**
 * Creates a new <code>SignaturePubKeyOrderDataType</code> XML object
 *
 * @param signaturePubKeyInfo the <code>SignaturePubKeyInfoType</code> element
 * @param partnerId the partner ID
 * @param userId the user ID
 * @return the <code>SignaturePubKeyOrderDataType</code> XML object
 */
public static SignaturePubKeyOrderDataType createSignaturePubKeyOrderData(SignaturePubKeyInfoType signaturePubKeyInfo, String partnerId, String userId) {
    SignaturePubKeyOrderDataType newSignaturePubKeyOrderDataType = SignaturePubKeyOrderDataType.Factory.newInstance();
    newSignaturePubKeyOrderDataType.setSignaturePubKeyInfo(signaturePubKeyInfo);
    newSignaturePubKeyOrderDataType.setPartnerID(partnerId);
    newSignaturePubKeyOrderDataType.setUserID(userId);
    return newSignaturePubKeyOrderDataType;
}
Also used : SignaturePubKeyOrderDataType(com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType)

Example 2 with SignaturePubKeyOrderDataType

use of com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createSignaturePubKeyOrderDataDocument.

// -----------------------------------------------------------------------------------------------------------------------------------------------
/**
 * Creates a new <code>SignaturePubKeyOrderDataDocument</code> XML object
 *
 * @param signaturePubKeyOrderData the <code>SignaturePubKeyOrderDataType</code> element
 * @return
 */
public static SignaturePubKeyOrderDataDocument createSignaturePubKeyOrderDataDocument(SignaturePubKeyOrderDataType signaturePubKeyOrderData) {
    SignaturePubKeyOrderDataDocument newSignaturePubKeyOrderDataDocument = SignaturePubKeyOrderDataDocument.Factory.newInstance();
    newSignaturePubKeyOrderDataDocument.setSignaturePubKeyOrderData(signaturePubKeyOrderData);
    return newSignaturePubKeyOrderDataDocument;
}
Also used : SignaturePubKeyOrderDataDocument(com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataDocument)

Example 3 with SignaturePubKeyOrderDataType

use of com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType in project axelor-open-suite by axelor.

the class SignaturePubKeyOrderDataElement method build.

@Override
public void build() throws AxelorException {
    SignaturePubKeyInfoType signaturePubKeyInfo;
    X509DataType x509Data;
    RSAKeyValueType rsaKeyValue;
    PubKeyValueType pubKeyValue;
    SignaturePubKeyOrderDataType signaturePubKeyOrderData;
    EbicsCertificate certificate = session.getUser().getA005Certificate();
    System.out.println("Certificate : " + new String(certificate.getCertificate()));
    System.out.println("Certificate size : " + certificate.getCertificate().length);
    EbicsCertificate ebicsEertificate = session.getUser().getA005Certificate();
    // Include certificate issuer and serial (certificate information)
    // x509Data = EbicsXmlFactory.createX509DataType(ebicsEertificate.getSubject(), certEncoded,
    // ebicsEertificate.getIssuer(),  new BigInteger(ebicsEertificate.getSerial(), 16));
    x509Data = EbicsXmlFactory.createX509DataType(ebicsEertificate.getSubject(), ebicsEertificate.getCertificate());
    rsaKeyValue = EbicsXmlFactory.createRSAKeyValueType(new BigInteger(ebicsEertificate.getPublicKeyExponent(), 16).toByteArray(), new BigInteger(ebicsEertificate.getPublicKeyModulus(), 16).toByteArray());
    pubKeyValue = EbicsXmlFactory.createPubKeyValueType(rsaKeyValue, Calendar.getInstance());
    signaturePubKeyInfo = EbicsXmlFactory.createSignaturePubKeyInfoType(x509Data, pubKeyValue, "A005");
    signaturePubKeyOrderData = EbicsXmlFactory.createSignaturePubKeyOrderData(signaturePubKeyInfo, session.getUser().getEbicsPartner().getPartnerId(), session.getUser().getUserId());
    document = EbicsXmlFactory.createSignaturePubKeyOrderDataDocument(signaturePubKeyOrderData);
}
Also used : X509DataType(com.axelor.apps.account.ebics.schema.xmldsig.X509DataType) EbicsCertificate(com.axelor.apps.bankpayment.db.EbicsCertificate) PubKeyValueType(com.axelor.apps.account.ebics.schema.s001.PubKeyValueType) SignaturePubKeyOrderDataType(com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType) BigInteger(java.math.BigInteger) RSAKeyValueType(com.axelor.apps.account.ebics.schema.xmldsig.RSAKeyValueType) SignaturePubKeyInfoType(com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyInfoType)

Aggregations

SignaturePubKeyOrderDataType (com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataType)2 PubKeyValueType (com.axelor.apps.account.ebics.schema.s001.PubKeyValueType)1 SignaturePubKeyInfoType (com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyInfoType)1 SignaturePubKeyOrderDataDocument (com.axelor.apps.account.ebics.schema.s001.SignaturePubKeyOrderDataDocument)1 RSAKeyValueType (com.axelor.apps.account.ebics.schema.xmldsig.RSAKeyValueType)1 X509DataType (com.axelor.apps.account.ebics.schema.xmldsig.X509DataType)1 EbicsCertificate (com.axelor.apps.bankpayment.db.EbicsCertificate)1 BigInteger (java.math.BigInteger)1