public AttributeCertificateHolder(X500Principal issuerName, BigInteger serialNumber) { this(X509Util.convertPrincipal(issuerName), serialNumber); }
/** * Return an iterator of the signature names supported by the generator. * * @return an iterator containing recognised names. */ public Iterator getSignatureAlgNames() { return X509Util.getAlgNames(); } }
/** * Set the signature algorithm. This can be either a name or an OID, names * are treated as case insensitive. * * @param signatureAlgorithm string representation of the algorithm name. */ public void setSignatureAlgorithm( String signatureAlgorithm) { this.signatureAlgorithm = signatureAlgorithm; try { sigOID = X509Util.getAlgorithmOID(signatureAlgorithm); } catch (Exception e) { throw new IllegalArgumentException("Unknown signature type requested: " + signatureAlgorithm); } sigAlgId = X509Util.getSigAlgID(sigOID, signatureAlgorithm); tbsGen.setSignature(sigAlgId); }
/** * generate an X509 CRL, based on the current issuer and subject, * using the passed in provider for the signing. */ public X509CRL generate( PrivateKey key, String provider, SecureRandom random) throws CRLException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { TBSCertList tbsCrl = generateCertList(); byte[] signature; try { signature = X509Util.calculateSignature(sigOID, signatureAlgorithm, provider, key, random, tbsCrl); } catch (IOException e) { throw new ExtCRLException("cannot generate CRL encoding", e); } return generateJcaObject(tbsCrl, signature); }
public static X509Store getInstance(String type, X509StoreParameters parameters, Provider provider) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type, provider); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
Implementation imp = getImplementation(baseName, Strings.toUpperCase(algorithm), prov[i]); if (imp != null) imp = getImplementation(baseName, algorithm, prov[i]);
params.put("SHA1WITHRSAANDMGF1", creatPSSParams(sha1AlgId, 20)); params.put("SHA224WITHRSAANDMGF1", creatPSSParams(sha224AlgId, 28)); params.put("SHA256WITHRSAANDMGF1", creatPSSParams(sha256AlgId, 32)); params.put("SHA384WITHRSAANDMGF1", creatPSSParams(sha384AlgId, 48)); params.put("SHA512WITHRSAANDMGF1", creatPSSParams(sha512AlgId, 64)); sig = X509Util.getSignatureInstance(sigName); sig = X509Util.getSignatureInstance(sigName, provider);
/** * Generates a X509StreamParser object for the specified type from the * specified provider. * * @param type * the name of the requested X.509 object type. * @param provider * the name of the provider. * * @return a X509StreamParser object for the specified type. * * @exception NoSuchParserException * if the type is not available from the specified provider. * * @exception NoSuchProviderException * if the provider can not be found. * * @see Provider */ public static X509StreamParser getInstance(String type, String provider) throws NoSuchParserException, NoSuchProviderException { return getInstance(type, X509Util.getProvider(provider)); }
/** * generate an X509 certificate, based on the current issuer and subject, * using the passed in provider for the signing, and the passed in source * of randomness (if required). */ public X509Certificate generate( PrivateKey key, String provider, SecureRandom random) throws CertificateEncodingException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { TBSCertificate tbsCert = tbsGen.generateTBSCertificate(); byte[] signature; try { signature = X509Util.calculateSignature(sigOID, signatureAlgorithm, provider, key, random, tbsCert); } catch (IOException e) { throw new ExtCertificateEncodingException("exception encoding TBS cert", e); } return generateJcaObject(tbsCert, signature); }
public static X509Store getInstance(String type, X509StoreParameters parameters, Provider provider) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type, provider); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
Implementation imp = getImplementation(baseName, Strings.toUpperCase(algorithm), prov[i]); if (imp != null) imp = getImplementation(baseName, algorithm, prov[i]);
params.put("SHA1WITHRSAANDMGF1", creatPSSParams(sha1AlgId, 20)); params.put("SHA224WITHRSAANDMGF1", creatPSSParams(sha224AlgId, 28)); params.put("SHA256WITHRSAANDMGF1", creatPSSParams(sha256AlgId, 32)); params.put("SHA384WITHRSAANDMGF1", creatPSSParams(sha384AlgId, 48)); params.put("SHA512WITHRSAANDMGF1", creatPSSParams(sha512AlgId, 64)); sig = X509Util.getSignatureInstance(sigName); sig = X509Util.getSignatureInstance(sigName, provider);
/** * Generates a X509StreamParser object for the specified type from the * specified provider. * * @param type * the name of the requested X.509 object type. * @param provider * the name of the provider. * * @return a X509StreamParser object for the specified type. * * @exception NoSuchParserException * if the type is not available from the specified provider. * * @exception NoSuchProviderException * if the provider can not be found. * * @see Provider */ public static X509StreamParser getInstance(String type, String provider) throws NoSuchParserException, NoSuchProviderException { return getInstance(type, X509Util.getProvider(provider)); }
/** * Set the signature algorithm. This can be either a name or an OID, names * are treated as case insensitive. * * @param signatureAlgorithm string representation of the algorithm name. */ public void setSignatureAlgorithm( String signatureAlgorithm) { this.signatureAlgorithm = signatureAlgorithm; try { sigOID = X509Util.getAlgorithmOID(signatureAlgorithm); } catch (Exception e) { throw new IllegalArgumentException("Unknown signature type requested"); } sigAlgId = X509Util.getSigAlgID(sigOID, signatureAlgorithm); tbsGen.setSignature(sigAlgId); }
/** * generate an X509 CRL, based on the current issuer and subject, * using the passed in provider for the signing. */ public X509CRL generate( PrivateKey key, String provider, SecureRandom random) throws CRLException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { TBSCertList tbsCrl = generateCertList(); byte[] signature; try { signature = X509Util.calculateSignature(sigOID, signatureAlgorithm, provider, key, random, tbsCrl); } catch (IOException e) { throw new ExtCRLException("cannot generate CRL encoding", e); } return generateJcaObject(tbsCrl, signature); }
public static X509Store getInstance(String type, X509StoreParameters parameters) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
/** * Return an iterator of the signature names supported by the generator. * * @return an iterator containing recognised names. */ public Iterator getSignatureAlgNames() { return X509Util.getAlgNames(); }
public AttributeCertificateHolder(X500Principal principal) { this(X509Util.convertPrincipal(principal)); }
/** * Set the signature algorithm. This can be either a name or an OID, names * are treated as case insensitive. * * @param signatureAlgorithm string representation of the algorithm name. */ public void setSignatureAlgorithm( String signatureAlgorithm) { this.signatureAlgorithm = signatureAlgorithm; try { sigOID = X509Util.getAlgorithmOID(signatureAlgorithm); } catch (Exception e) { throw new IllegalArgumentException("Unknown signature type requested: " + signatureAlgorithm); } sigAlgId = X509Util.getSigAlgID(sigOID, signatureAlgorithm); tbsGen.setSignature(sigAlgId); }
/** * generate an X509 certificate, based on the current issuer and subject, * using the passed in provider for the signing, and the passed in source * of randomness (if required). */ public X509Certificate generate( PrivateKey key, String provider, SecureRandom random) throws CertificateEncodingException, IllegalStateException, NoSuchProviderException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { TBSCertificate tbsCert = tbsGen.generateTBSCertificate(); byte[] signature; try { signature = X509Util.calculateSignature(sigOID, signatureAlgorithm, provider, key, random, tbsCert); } catch (IOException e) { throw new ExtCertificateEncodingException("exception encoding TBS cert", e); } return generateJcaObject(tbsCert, signature); }