Examples of verifySignature()


Examples of com.cloud.bridge.util.EC2RestAuth.verifySignature()

                }
            }
        }
        restAuth.setQueryString(queryString);

        if ( restAuth.verifySignature( request.getMethod(), cloudSecretKey, signature, sigMethod )) {
            UserContext.current().initContext( cloudAccessKey, cloudSecretKey, cloudAccessKey, "REST request", null );
            return true;
        }
        else throw new EC2ServiceException( ClientError.SignatureDoesNotMatch,
                "The request signature calculated does not match the signature provided by the user.");
View Full Code Here

Examples of com.cloud.bridge.util.RestAuth.verifySignature()

        UserInfo info = ServiceProvider.getInstance().getUserInfo(AWSAccessKey);
        if (info == null) throw new PermissionDeniedException("Unable to authenticate access key: " + AWSAccessKey);

        try {
            if (auth.verifySignature( request.getMethod(), info.getSecretKey(), signature )) {
                UserContext.current().initContext(AWSAccessKey, info.getSecretKey(), AWSAccessKey, info.getDescription(), request);
                return;
            }

View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

        NoCRLException,
        GeneralSecurityException
    {
        // Get all the information about the signature.
        AcroFields fields = reader.getAcroFields();
        PdfPKCS7 pkcs7 = fields.verifySignature(signature);

        // Use the signature to check the document integrity.
        if (!pkcs7.verify()) {
            throw new InvalidSignatureException(
                String.format(messages.getString(
View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

        Map<String, PdfPKCS7> result = new LinkedHashMap<String, PdfPKCS7>();

        // Get signature data encoded in PKCS #7 format for each signature.
        for (String signature : signatures) {
            // Verify the signature.
            PdfPKCS7 pkcs7 = fields.verifySignature(signature);

            // Check if the signature is a document level timestamp.
            if (pkcs7.isTsp() && !includeTimestamps) {
                // Skip document level timestamps.
                continue;
View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

                "Document_has_no_signature."));
        }

        // Check if the last signature is a timestamp.
        String lastSignature = signatures.get(signatures.size() - 1);
        PdfPKCS7 pkcs7 = fields.verifySignature(lastSignature);
        if (pkcs7.isTsp()) {
            // Prepare to store certificates, OCSP responses and CRLs only for the last timestamp.
            signatures.clear();
            signatures.add(lastSignature);
        }
View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

        HashMap<String, ArrayList<BasicOCSPResp>> ocspMap = new HashMap<String, ArrayList<BasicOCSPResp>>();

        // Store certificates, OCSP responses and CRLs for each signature.
        for (String signature : signatures) {
            // Get signature data.
            pkcs7 = fields.verifySignature(signature);

            // Get certificate path.
            X509Certificate signingCertificate = (X509Certificate) factory.generateCertificate(
                new ByteArrayInputStream(pkcs7.getSigningCertificate().getEncoded()));
            Certificate[] chain = pkcs7.getSignCertificateChain();
View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

                "Document_has_no_signature."));
        }

        // Check if the last signature is a timestamp.
        String lastSignature = signatures.get(signatures.size() - 1);
        PdfPKCS7 pkcs7 = fields.verifySignature(lastSignature);
        if (!pkcs7.isTsp()) {
            throw new NoTimestampException(messages.getString(
                "Document_has_no_document_level_timestamp."));
        }
View Full Code Here

Examples of com.itextpdf.text.pdf.AcroFields.verifySignature()

        Calendar date = pkcs7.getTimeStampDate();

        // Validate others signatures using date of the timestamp.
        for (int i = signatures.size() - 2; i >= 0; i--) {
            // Get next signature.
            pkcs7 = fields.verifySignature(signatures.get(i));

            // Validate next signature.
            SignatureValidator.validate(
                signatures.get(i), reader, rootCertificates, ocsps, crls, date);
View Full Code Here

Examples of com.lowagie.text.pdf.AcroFields.verifySignature()

      for (String name : tmpNames) {
        final SignatureVerification tmpVerif = new SignatureVerification(name);
        tmpVerif.setWholeDocument(tmpAcroFields.signatureCoversWholeDocument(name));
        tmpVerif.setRevision(tmpAcroFields.getRevision(name));
        final PdfPKCS7 pk = tmpAcroFields.verifySignature(name);
        tmpVerif.setDate(pk.getSignDate());
        tmpVerif.setLocation(pk.getLocation());
        tmpVerif.setReason(pk.getReason());
        tmpVerif.setSignName(pk.getSignName());
        final Certificate pkc[] = pk.getCertificates();
View Full Code Here

Examples of com.subgraph.orchid.crypto.TorPublicKey.verifySignature()

      return SignatureStatus.STATUS_FAILED;
    }
   
    final TorPublicKey signingKey = certificate.getAuthoritySigningKey();
    final HexDigest d = (signature.useSha256()) ? signingHash256 : signingHash;
    if(!signingKey.verifySignature(signature.getSignature(), d)) {
      logger.warning("Signature failed on consensus for signing key: "+ signature.getSigningKeyDigest());
      return SignatureStatus.STATUS_FAILED;
    }
    return SignatureStatus.STATUS_VERIFIED;
  }
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.