Codota Logo
DSSASN1Utils.toASN1Primitive
Code IndexAdd Codota to your IDE (free)

How to use
toASN1Primitive
method
in
eu.europa.ec.markt.dss.DSSASN1Utils

Best Java code snippets using eu.europa.ec.markt.dss.DSSASN1Utils.toASN1Primitive (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: arhs/sd-dss

/**
 * This method checks if a given {@code DEROctetString} is null.
 *
 * @param derOctetString
 * @return
 */
public static boolean isDEROctetStringNull(final DEROctetString derOctetString) {
  final byte[] derOctetStringBytes = derOctetString.getOctets();
  final ASN1Primitive asn1Null = DSSASN1Utils.toASN1Primitive(derOctetStringBytes);
  return DERNull.INSTANCE.equals(asn1Null);
}
origin: arhs/sd-dss

/**
 * Indicates if this certificate has an CRL extension expiredCertOnCRL.
 *
 * @return
 */
public boolean hasExpiredCertOnCRLExtension() {
  final byte[] extensionValue = x509Certificate.getExtensionValue(OID.id_ce_expiredCertsOnCRL.getId());
  if (extensionValue != null) {
    try {
      final ASN1Primitive derObject = DSSASN1Utils.toASN1Primitive(extensionValue);
      if (derObject instanceof DEROctetString) {
        final boolean derOctetStringNull = DSSASN1Utils.isDEROctetStringNull((DEROctetString) derObject);
        return derOctetStringNull;
      }
    } catch (Exception e) {
      LOG.debug("Exception when processing 'id_ce_expiredCertsOnCRL'", e);
    }
  }
  return false;
}
origin: arhs/sd-dss

@Override
public byte[] getBytes() throws DSSException {
  try {
    final ByteArrayOutputStream output = new ByteArrayOutputStream();
    final DEROutputStream derOutputStream = new DEROutputStream(output);
    final byte[] encoded = signedData.getEncoded();
    final ASN1Primitive asn1Primitive = DSSASN1Utils.toASN1Primitive(encoded);
    derOutputStream.writeObject(asn1Primitive);
    derOutputStream.close();
    return output.toByteArray();
  } catch (IOException e) {
    throw new DSSException(e);
  }
}
origin: arhs/sd-dss

/**
 * Indicates if the revocation data should be checked for an OCSP signing certificate.<br>
 * http://www.ietf.org/rfc/rfc2560.txt?number=2560<br>
 * A CA may specify that an OCSP client can trust a responder for the lifetime of the responder's certificate. The CA
 * does so by including the extension id-pkix-ocsp-nocheck. This SHOULD be a non-critical extension. The value of the
 * extension should be NULL.
 *
 * @return
 */
public boolean hasIdPkixOcspNoCheckExtension() {
  final byte[] extensionValue = x509Certificate.getExtensionValue(OID.id_pkix_ocsp_no_check.getId());
  if (extensionValue != null) {
    try {
      final ASN1Primitive derObject = DSSASN1Utils.toASN1Primitive(extensionValue);
      if (derObject instanceof DEROctetString) {
        final boolean derOctetStringNull = DSSASN1Utils.isDEROctetStringNull((DEROctetString) derObject);
        return derOctetStringNull;
      }
    } catch (Exception e) {
      LOG.debug("Exception when processing 'id_pkix_ocsp_no_check'", e);
    }
  }
  return false;
}
origin: arhs/sd-dss

  /**
   * @param signerInformation {@code SignerInformation}
   * @return {@code DERTaggedObject} representing the signed attributes
   * @throws DSSException in case of a decoding problem
   */
  public static DERTaggedObject getSignedAttributes(final SignerInformation signerInformation) throws DSSException {

    try {
      final byte[] encodedSignedAttributes = signerInformation.getEncodedSignedAttributes();
      if (encodedSignedAttributes == null) {
        return null;
      }
      final ASN1Set asn1Set = DSSASN1Utils.toASN1Primitive(encodedSignedAttributes);
      return new DERTaggedObject(false, 0, asn1Set);
    } catch (IOException e) {
      throw new DSSException(e);
    }
  }
}
origin: arhs/sd-dss

for (final TimestampToken contentTimestamp : contentTimestamps) {
  final ASN1Object asn1Object = DSSASN1Utils.toASN1Primitive(contentTimestamp.getEncoded());
  final DERSet attrValues = new DERSet(asn1Object);
  final Attribute attribute = new Attribute(id_aa_ets_contentTimestamp, attrValues);
origin: arhs/sd-dss

  return DSSASN1Utils.toASN1Primitive(newTimeStampTokenBytes);
} catch (IOException e) {
  throw new DSSException(e);
origin: arhs/sd-dss

for (final OCSPToken ocspToken : revocationDataForInclusion.ocspTokens) {
  final BasicOCSPResp basicOCSPResp = ocspToken.getBasicOCSPResp();
  newOtherRevocationInfoFormatStore.add(DSSASN1Utils.toASN1Primitive(DSSUtils.getEncoded(basicOCSPResp)));
origin: arhs/sd-dss

final ASN1Sequence asn1Sequence = DSSASN1Utils.toASN1Primitive(policyBytes);
final ASN1Sequence signPolicyHashAlgObject = (ASN1Sequence) asn1Sequence.getObjectAt(0);
final AlgorithmIdentifier signPolicyHashAlgIdentifier = AlgorithmIdentifier.getInstance(signPolicyHashAlgObject);
eu.europa.ec.markt.dssDSSASN1UtilstoASN1Primitive

Javadoc

This method returns T extends ASN1Primitive created from array of bytes. The IOException is transformed in DSSException.

Popular methods of DSSASN1Utils

  • getAsn1SequenceFromDerOctetString
    This method returns the ASN1Sequence encapsulated in DEROctetString. The DEROctetString is represent
  • getDEREncoded
    This method return DER encoded ASN1 attribute. The IOException is transformed in DSSException.
  • createTimeStampToken
    This method generates a bouncycastle TimeStampToken based on base 64 encoded String.
  • generateCMSSignedData
    This method generate CMSSignedData using the provided # CMSSignedDataGenerator, the content and the
  • getBasicOCSPResp
    This method returns the BasicOCSPResp from a OCSPResp.
  • getBasicOcspResp
    This method allows to create a BasicOCSPResp from a DERSequence.
  • getEncoded
    Returns an ASN.1 encoded bytes representing the TimeStampToken
  • getOcspResp
    This method allows to create a OCSPResp from a DERSequence.
  • getSignedAttributes
  • isDEROctetStringNull
    This method checks if a given DEROctetString is null.
  • toDate
  • toString
  • toDate,
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Notification (javax.management)
  • JList (javax.swing)
  • JTable (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now