Example usage for org.bouncycastle.crypto.signers ISO9796d2Signer ISO9796d2Signer

List of usage examples for org.bouncycastle.crypto.signers ISO9796d2Signer ISO9796d2Signer

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.signers ISO9796d2Signer ISO9796d2Signer.

Prototype

public ISO9796d2Signer(AsymmetricBlockCipher cipher, Digest digest, boolean implicit) 

Source Link

Document

Generate a signer with either implicit or explicit trailers for ISO9796-2.

Usage

From source file:org.irmacard.mno.common.EDlData.java

@Override
protected SignerWithRecovery getRSASigner() {
    SignerWithRecovery signer = null;// w  ww  .  j  a  v a2  s. c  o  m
    try {
        RSAEngine rsa = new RSAEngine();
        RSAPublicKey pub = (RSAPublicKey) getPublicKey(aaFile);
        RSAKeyParameters pubParameters = new RSAKeyParameters(false, pub.getModulus(), pub.getPublicExponent());
        signer = new ISO9796d2Signer(rsa, new SHA256Digest(), false);
        signer.init(false, pubParameters);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return signer;
}