Package java.security

Examples of java.security.SignatureException


            return sig;
        }
        catch (Exception e)
        {
            throw new SignatureException(e.toString());
        }
    }
View Full Code Here


        {
            return pss.generateSignature();
        }
        catch (CryptoException e)
        {
            throw new SignatureException(e.getMessage());
        }
    }
View Full Code Here

        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            md.update(text.getBytes());
            return toHex(md.digest());
        } catch (Exception e) {
            throw new SignatureException("Unable to compute hash while signing request: " + e.getMessage(), e);
        }
    }
View Full Code Here

            if (protocol.equals("http")) {
                return false;
            } else if (protocol.equals("https")) {
                return true;
            } else {
                throw new SignatureException("Unknown request endpoint protocol " +
                    "encountered while signing request: " + protocol);
            }
        } catch (MalformedURLException e) {
            throw new SignatureException("Unable to parse request endpoint during signing", e);
        }
    }
View Full Code Here

            request.addParameter("SignatureMethod", algorithm.toString());
            stringToSign = calculateStringToSignV2(request.getEndpoint(),
            request.getParameters());
        }
        else {
            throw new SignatureException("Invalid Signature Version specified");
        }

        String signatureValue = sign(stringToSign, credentials
                .getAWSSecretKey(), algorithm);
        request.addParameter("Signature", signatureValue);
View Full Code Here

        sig.initVerify(key);
        sig.update(this.getTBSCertList());
        if ( !sig.verify(this.getSignature()) )
        {
            throw new SignatureException("CRL does not verify with supplied public key.");
        }
    }
View Full Code Here

     * Signs the data
     */
    public byte[] sign() throws SignatureException {
       
        if (byte_length == 0) {
            throw new SignatureException
        ("length should be -1 or greater than zero, but is " + byte_length);
        }
       
        byte[] value = this.digest.digest();
       
View Full Code Here

  if (signature == null) {
      try {
                // FIXME: do other hashes besides sha-1
                signature = Signature.getInstance("SHA1withRSA");
      } catch (NoSuchAlgorithmException nsae) {
    throw new SignatureException("SHA1withRSA Signature not found");
      }
  }
        signature.initVerify((PublicKey) key);
  if (log.isLoggable(Level.FINE)) {
      log.log(Level.FINE, "Signature provider:"+ signature.getProvider());
View Full Code Here

  }
  if (signature == null) {
      try {
                signature = Signature.getInstance("SHA1withDSA");
      } catch (NoSuchAlgorithmException nsae) {
    throw new SignatureException("SHA1withDSA Signature not found");
      }
  }
        try {
            if (!(key instanceof PublicKey)) {
          throw new InvalidKeyException("key must be PublicKey");
View Full Code Here

      }
     
      if(isSigned){
        ParsedSignatureResult result = ExtRAMsgHelper.verifySignature(cACertChain,crls,messagedata);
        if(!result.isValid()){
          throw new SignatureException("Signature not valid");
        }
        this.signerCert = result.getSignerCert();
        messagedata = result.getContent();
      }
     
View Full Code Here

TOP

Related Classes of java.security.SignatureException

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.