Package org.bouncycastle.cms

Examples of org.bouncycastle.cms.CMSProcessableByteArray


        if ((this.parameters.isMergeSignatures()) && (this.isSigned(data))) {
          CMSSignedData signedData = new CMSSignedData(data);
          signedDataGenerator.addSigners(signedData.getSignerInfos());
          content = (CMSTypedData) signedData.getSignedContent();
        } else {
          content = new CMSProcessableByteArray(data);
        }

        if (PKCS7SignatureMode.DETACHED.equals(mode)) {
          encapsulate = false;
        }
View Full Code Here


      throw new SignerException(e);
    }
  }

  private boolean verifyAttached(final byte[] data, final byte[] signature) throws CMSException, IOException, OperatorCreationException, GeneralSecurityException {
    CMSSignedData signedData = new CMSSignedData(new CMSProcessableByteArray(data), signature);

    CollectionStore certificatesStore = (CollectionStore) signedData.getCertificates();

    SignerInformationStore signerInformationStore = signedData.getSignerInfos();
    boolean verified = true;
View Full Code Here

                byte[] signedData = baos.toByteArray();
                mOutputJar.write(signedData);

                // CERT.*
                mOutputJar.putNextEntry(new JarEntry("META-INF/CERT." + mKey.getAlgorithm()));
                writeSignatureBlock(new CMSProcessableByteArray(signedData), mCertificate, mKey);
            } catch (Exception e) {
                throw new SigningException(e);
            }
        }

View Full Code Here

        if ((this.parameters.isMergeSignatures()) && (this.isSigned(data))) {
          CMSSignedData signedData = new CMSSignedData(data);
          signedDataGenerator.addSigners(signedData.getSignerInfos());
          content = (CMSTypedData) signedData.getSignedContent();
        } else {
          content = new CMSProcessableByteArray(data);
        }

        if (PKCS7SignatureMode.DETACHED.equals(mode)) {
          encapsulate = false;
        }
View Full Code Here

      throw new SignerException(e);
    }
  }

  private boolean verifyAttached(final byte[] data, final byte[] signature) throws CMSException, IOException, OperatorCreationException, GeneralSecurityException {
    CMSSignedData signedData = new CMSSignedData(new CMSProcessableByteArray(data), signature);

    CollectionStore certificatesStore = (CollectionStore) signedData.getCertificates();

    SignerInformationStore signerInformationStore = signedData.getSignerInfos();
    boolean verified = true;
View Full Code Here

TOP

Related Classes of org.bouncycastle.cms.CMSProcessableByteArray

Copyright © 2018 www.massapicom. 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.