Examples of CMSSignedData


Examples of org.bouncycastle.cms.CMSSignedData

        log.debug("Enveloped data is " + ed.getEncoded().length + " bytes long");
        CMSProcessable msg = new CMSProcessableByteArray(ed.getEncoded());
        //
        // Create the outer signed data
        //
        CMSSignedData s = sign(msg, messageType, transactionId);
       
        byte[] ret = s.getEncoded();
        return ret;
       
    }
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

     * Genera il file p7m e lo salva nel path specificato.
     * Inserendo "false" come secondo parametro di generate() si
     * otterrebbe invece un file p7s, ovvero la sola firma "detached".
     */
    CMSProcessableFile content = new CMSProcessableFile(fileInput);
    CMSSignedData data = gen.generate(content, true);
    byte[] res = data.getEncoded();
    FileOutputStream fos = new FileOutputStream(fileFirmato);
    fos.write(res);
    fos.close();
  }
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

   * @throws Exception
   */
  public boolean verify(byte[] signedBytes)
     throws Exception
  {
    CMSSignedData s = new CMSSignedData(signedBytes);
    return verify(s, null);
  }
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

   * @throws Exception
   */
  public boolean verify(InputStream is)
     throws Exception
  {
    CMSSignedData s = new CMSSignedData(is);
    return verify(s, null);
  }
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

    InputStream is = new FileInputStream(inputFirmato);
    OutputStream os = outputOrginale == null ? null : new FileOutputStream(outputOrginale);

    try
    {
      CMSSignedData s = new CMSSignedData(is);
      rv = verify(s, os);
    }
    finally
    {
      is.close();
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

  {
    InputStream is = new FileInputStream(p7m);
    OutputStream os = new FileOutputStream(output);
    try
    {
      CMSSignedData sdp = new CMSSignedData(is);
      CMSProcessable cmsp = sdp.getSignedContent();
      os.write((byte[])cmsp.getContent());
    }
    finally
    {
      is.close();
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

  gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(
    new JcaDigestCalculatorProviderBuilder().build()).build(
    sha1Signer, cert));
  gen.addCertificates(certs);
  CMSTypedData msg = new CMSAbsentContent();
  CMSSignedData sigData = gen.generate(msg, false);

  params.add(new Object[] { new GetCert(transId, senderNonce, iasn) });
  params.add(new Object[] { new GetCertInitial(transId, senderNonce, ias) });
  params.add(new Object[] { new GetCrl(transId, senderNonce, iasn) });
  params.add(new Object[] { new PkcsReq(transId, senderNonce, csr) });
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

     * @throws TransactionException
     *             if any transaction-related error occurs.
     */
    @Override
    public State send() throws TransactionException {
  CMSSignedData signedData;
  try {
      signedData = encode(request);
  } catch (MessageEncodingException e) {
      throw new TransactionException(e);
  }
  LOGGER.debug("Sending {}", signedData);
  PkiOperationResponseHandler handler = new PkiOperationResponseHandler();
  CMSSignedData res = send(handler, new PkiOperationRequest(signedData));
  LOGGER.debug("Received response {}", res);

  CertRep response;
  try {
      response = (CertRep) decode(res);
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

     *             if an error was encountered when sending this transaction.
     */
    @Override
    public final State send() throws TransactionException {
  final PkiOperationResponseHandler handler = new PkiOperationResponseHandler();
  CMSSignedData signedData;
  try {
      signedData = encode(request);
  } catch (MessageEncodingException e) {
      throw new TransactionException(e);
  }

  CMSSignedData res = send(handler, new PkiOperationRequest(signedData));
  CertRep response;
  try {
      response = (CertRep) decode(res);
  } catch (MessageDecodingException e) {
      throw new TransactionException(e);
View Full Code Here

Examples of org.bouncycastle.cms.CMSSignedData

  return state;
    }

    CertStore extractCertStore(CertRep response) {
  CMSSignedData signedData = response.getMessageData();

  return SignedDataUtils.fromSignedData(signedData);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.