/** * Return true if this spec is for the default PRF (HmacSHA1), false otherwise. * * @return true if this spec uses the default PRF, false otherwise. */ public boolean isDefaultPrf() { return defaultPRF.equals(prf); }
/** * Return true if the PRF is the default (hmacWithSHA1) * * @return true if PRF is default, false otherwise. */ public boolean isDefaultPrf() { return prf == null || prf.equals(algid_hmacWithSHA1); }
/** * Return true if the PRF is the default (hmacWithSHA1) * * @return true if PRF is default, false otherwise. */ public boolean isDefaultPrf() { return prf == null || prf.equals(algid_hmacWithSHA1); }
private void writeObject( ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (!algorithmIdentifier.equals(DEFAULT_ALGORITHM_IDENTIFIER)) { out.writeObject(algorithmIdentifier.getEncoded()); } } }
private void doVerify(PublicKey key, Signature sig) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { if (!c.getSignatureAlgorithm().equals(c.getTBSCertList().getSignature())) { throw new CRLException("Signature algorithm on CertificateList does not match TBSCertList."); } sig.initVerify(key); sig.update(this.getTBSCertList()); if (!sig.verify(this.getSignature())) { throw new SignatureException("CRL does not verify with supplied public key."); } }
public final void verify( PublicKey key, String provider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException { Signature signature = null; if (!cert.getSignatureAlgorithm().equals(cert.getAcinfo().getSignature())) { throw new CertificateException("Signature algorithm in certificate info not same as outer certificate"); } signature = Signature.getInstance(cert.getSignatureAlgorithm().getAlgorithm().getId(), provider); signature.initVerify(key); try { signature.update(cert.getAcinfo().getEncoded()); } catch (IOException e) { throw new SignatureException("Exception encoding certificate info object"); } if (!signature.verify(this.getSignature())) { throw new InvalidKeyException("Public key presented not for certificate signature"); } }
private void doVerify(PublicKey key, Signature sig) throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { if (!c.getSignatureAlgorithm().equals(c.getTBSCertList().getSignature())) { throw new CRLException("Signature algorithm on CertificateList does not match TBSCertList."); } if (sigAlgParams != null) { try { // needs to be called before initVerify(). X509SignatureUtil.setSignatureParameters(sig, ASN1Primitive.fromByteArray(sigAlgParams)); } catch (IOException e) { throw new SignatureException("cannot decode signature parameters: " + e.getMessage()); } } sig.initVerify(key); sig.update(this.getTBSCertList()); if (!sig.verify(this.getSignature())) { throw new SignatureException("CRL does not verify with supplied public key."); } }
vector.add(algorithmIdentifier); if (algorithmIdentifier.equals(algId))
/** * Return an ASN.1 structure suitable for encoding. * * @return the object as an ASN.1 encodable structure. */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(octStr); v.add(iterationCount); if (keyLength != null) { v.add(keyLength); } if (prf != null && !prf.equals(algid_hmacWithSHA1)) { v.add(prf); } return new DERSequence(v); } }
/** * Return an ASN.1 structure suitable for encoding. * * @return the object as an ASN.1 encodable structure. */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(octStr); v.add(iterationCount); if (keyLength != null) { v.add(keyLength); } if (prf != null && !prf.equals(algid_hmacWithSHA1)) { v.add(prf); } return new DERSequence(v); } }
if (!hashAlgorithm.equals(DEFAULT_ALG_ID))
if (!hashAlgorithm.equals(DEFAULT_ALG_ID))
if (!storeData.getIntegrityAlgorithm().equals(integrityAlg))
if (!params.getPSourceAlgorithm().equals(RSAESOAEPparams.DEFAULT_P_SOURCE_ALGORITHM)) { throw new Exception( "unsupported RSAESOAEPparams.PSourceAlgorithm " + oid.getId());
if (!params.getPSourceAlgorithm().equals(RSAESOAEPparams.DEFAULT_P_SOURCE_ALGORITHM)) { throw new XiSecurityException( "unsupported RSAESOAEPparams.PSourceAlgorithm " + oid.getId());