/** * Sets the signatureCreator property in the underlying * {@link PdfSignatureAppDictionary} dictionary. * * @param name */ public void setSignatureCreator(String name) { getPdfSignatureAppProperty().setSignatureCreator(name); }
/** * Gets the MessageDigest to digest the data imprint * @return the digest algorithm name */ public MessageDigest getMessageDigest() throws GeneralSecurityException { return new BouncyCastleDigest().getMessageDigest(digestAlgorithm); }
/** * Creates a CrlClientOnline instance using one or more URLs. */ public CrlClientOnline(String... crls) { for (String url : crls) { addUrl(url); } }
/** * Gets a CRL from a certificate * @param certificate * @return the CRL or null if there's no CRL available * @throws CertificateException * @throws CRLException * @throws IOException */ public static CRL getCRL(X509Certificate certificate) throws CertificateException, CRLException, IOException { return CertificateUtil.getCRL(CertificateUtil.getCRLURL(certificate)); }
/** * Get the algorithm used to calculate the message digest, e.g. "SHA1withRSA". * @return the algorithm used to calculate the message digest */ public String getDigestAlgorithm() { return getHashAlgorithm() + "with" + getEncryptionAlgorithm(); }
/** * Signs the xml with XmlDSig using the enveloped mode, with optional xpath transform (see XmlSignatureAppearance). * @param sap the XmlSignatureAppearance * @param externalSignature the interface providing the actual signing * @param publicKey PublicKey for verification * @throws GeneralSecurityException * @throws IOException * @throws DocumentException */ public static void signXmlDSig(XmlSignatureAppearance sap, ExternalSignature externalSignature, PublicKey publicKey) throws GeneralSecurityException, DocumentException, IOException { signXmlDSig(sap, externalSignature, generateKeyInfo(publicKey)); }
/** * Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes * in the signerInfo can also be set. If either of the parameters is <CODE>null</CODE>, none will be used. * @param secondDigest the digest in the authenticatedAttributes * @return the bytes for the PKCS7SignedData object */ public byte[] getEncodedPKCS7(byte secondDigest[]) { return getEncodedPKCS7(secondDigest, null, null, null, CryptoStandard.CMS); }
public LtvVerification getLtvVerification() { if (verification == null) verification = new LtvVerification(this); return verification; }
/** * Getter for property signDate. * @return Value of property signDate. */ public Calendar getSignDate() { Calendar dt = getTimeStampDate(); if (dt == null) return this.signDate; else return dt; }
void mergeVerification() throws IOException { if (verification == null) return; verification.merge(); }
/** * Returns the encryption algorithm * @return the name of an encryption algorithm */ public String getEncryptionAlgorithm() { String encryptAlgo = EncryptionAlgorithms.getAlgorithm(digestEncryptionAlgorithmOid); if (encryptAlgo == null) encryptAlgo = digestEncryptionAlgorithmOid; return encryptAlgo; } }
/** * Verifies a certificate chain against a KeyStore. * @param certs the certificate chain * @param keystore the <CODE>KeyStore</CODE> * @param calendar the date or <CODE>null</CODE> for the current date * @return <CODE>null</CODE> if the certificate chain could be validated or a * <CODE>Object[]{cert,error}</CODE> where <CODE>cert</CODE> is the * failed certificate and <CODE>error</CODE> is the error message */ public static List<VerificationException> verifyCertificates(Certificate certs[], KeyStore keystore, Calendar calendar) { return verifyCertificates(certs, keystore, null, calendar); }
/** * Loads the default root certificates at <java.home>/lib/security/cacerts * with the default provider. * @return a <CODE>KeyStore</CODE> */ public static KeyStore loadCacertsKeyStore() { return loadCacertsKeyStore(null); }
/** * Sets the signatureCreator property in the underlying * {@link PdfSignatureAppDictionary} dictionary. * * @param name */ public void setSignatureCreator(String name) { getPdfSignatureAppProperty().setSignatureCreator(name); }
/** * Gets a CRL from a certificate * @param certificate * @return the CRL or null if there's no CRL available * @throws CertificateException * @throws CRLException * @throws IOException */ public static CRL getCRL(X509Certificate certificate) throws CertificateException, CRLException, IOException { return CertificateUtil.getCRL(CertificateUtil.getCRLURL(certificate)); }
/** * Creates a CrlClientOnline instance using one or more URLs. */ public CrlClientOnline(URL... crls) { for (URL url : urls) { addUrl(url); } }
public LtvVerification getLtvVerification() { if (verification == null) verification = new LtvVerification(this); return verification; }
/** * Getter for property signDate. * @return Value of property signDate. */ public Calendar getSignDate() { Calendar dt = getTimeStampDate(); if (dt == null) return this.signDate; else return dt; }
/** * Creates a CrlClientOnline instance using one or more URLs. */ public CrlClientOnline(String... crls) { for (String url : crls) { addUrl(url); } }
/** * Creates a CrlClientOnline instance using one or more URLs. */ public CrlClientOnline(URL... crls) { for (URL url : urls) { addUrl(url); } }