Example usage for org.bouncycastle.asn1.icao LDSSecurityObject LDSSecurityObject

List of usage examples for org.bouncycastle.asn1.icao LDSSecurityObject LDSSecurityObject

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.icao LDSSecurityObject LDSSecurityObject.

Prototype

private LDSSecurityObject(ASN1Sequence seq) 

Source Link

Usage

From source file:passwdmanager.hig.no.lds.DG_SOD.java

/**
 * Reads the security object (containing the hashes of the data groups)
 * found in the SOD on the card./*from w  ww . ja va2  s  .  co m*/
 * 
 * @return the security object
 * 
 * @throws IOException
 */
private static LDSSecurityObject getSecurityObject(SignedData signedData) {
    try {
        ContentInfo contentInfo = signedData.getEncapContentInfo();
        byte[] content = ((DEROctetString) contentInfo.getContent()).getOctets();
        ASN1InputStream in = new ASN1InputStream(new ByteArrayInputStream(content));

        LDSSecurityObject sod = new LDSSecurityObject((DERSequence) in.readObject());
        Object nextObject = in.readObject();

        if (nextObject != null) {
            System.err.println("WARNING: extra object found after LDSSecurityObject...");
        }
        return sod;
    } catch (IOException ioe) {
        throw new IllegalStateException("Could not read security object in signedData");
    }
}