Example usage for org.bouncycastle.asn1.cms CompressedData getCompressionAlgorithmIdentifier

List of usage examples for org.bouncycastle.asn1.cms CompressedData getCompressionAlgorithmIdentifier

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.cms CompressedData getCompressionAlgorithmIdentifier.

Prototype

public AlgorithmIdentifier getCompressionAlgorithmIdentifier() 

Source Link

Usage

From source file:es.gob.afirma.applet.CMSInformation.java

License:Open Source License

/**
 * Obtiene la información de un tipo Compressed Data.
 * @return  Representación de los datos.
 *//*from ww w  .  j  a  v a  2s  .c  o m*/
private static String getFromCompressedData(final ASN1TaggedObject doj) {
    String detalle = ""; //$NON-NLS-1$
    detalle = detalle + "Tipo:" + SP + COMPRESSED_DATA + CR; //$NON-NLS-1$
    final CompressedData ed = CompressedData.getInstance(doj.getObject());

    //obtenemos la version
    detalle = detalle + AppletMessages.getString("CMSInformation.1") + SP + ed.getVersion() + CR; //$NON-NLS-1$

    final AlgorithmIdentifier aid = ed.getCompressionAlgorithmIdentifier();
    if (aid.getAlgorithm().toString().equals("1.2.840.113549.1.9.16.3.8")) { //$NON-NLS-1$
        detalle = detalle + "OID del Algoritmo de firma: ZLIB" + CR; //$NON-NLS-1$
    } else {
        detalle = detalle + "OID del Algoritmo de firma:" + SP + aid.getAlgorithm() + CR; //$NON-NLS-1$
    }

    return detalle;
}