|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nhindirect.stagent.CryptoExtensions
public class CryptoExtensions
Utility functions for searching for certificates.
| Constructor Summary | |
|---|---|
CryptoExtensions()
|
|
| Method Summary | |
|---|---|
static boolean |
certSubjectContainsName(X509Certificate cert,
String name)
Checks if a name is contained in a certificate's DN or alt subjects. |
static boolean |
containsEmailAddressInSubjectAltName(X509Certificate cert,
String subjectName)
Deprecated. As of 1.1.5. Use certSubjectContainsName(X509Certificate, String) |
static X509Certificate |
findCertByName(Collection<X509Certificate> certs,
String name)
Searches a collection of X509Certificates for a certificate that matches the provided name. |
static SignerCertPair |
findSignerByCert(org.bouncycastle.cms.CMSSignedData signedData,
X509Certificate searchCert)
Searches CMS signed data for a specific X509 certificate. |
static Collection<SignerCertPair> |
findSignersByName(org.bouncycastle.cms.CMSSignedData signedData,
String name,
Collection<String> excludeNames)
Searches CMS signed data for a given email name. |
static String |
getJCEProviderName()
Gets the configured JCE crypto provider string for crypto operations. |
static String |
getSubjectAddress(X509Certificate certificate)
Gets the address name associated with the certificate. |
static boolean |
isEqualThumbprint(X509Certificate cert1,
X509Certificate cert2)
Compares the thumbprints of two certificates for equality. |
static boolean |
matchName(X509Certificate cert,
String name)
Deprecated. As of 1.1.5. Use certSubjectContainsName(X509Certificate, String) |
static void |
setJCEProviderName(String name)
Overrides the configured JCE crypto provider string. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CryptoExtensions()
| Method Detail |
|---|
public static String getJCEProviderName()
public static void setJCEProviderName(String name)
name - The name of the JCE provider.
public static boolean isEqualThumbprint(X509Certificate cert1,
X509Certificate cert2)
thumbprints of two certificates for equality.
cert1 - The first certificate to compare.cert2 - The second certificate to compare.
public static boolean containsEmailAddressInSubjectAltName(X509Certificate cert,
String subjectName)
certSubjectContainsName(X509Certificate, String)
cert - The certificate to check.subjectName - The subject name to check in the alternate names.
public static boolean certSubjectContainsName(X509Certificate cert,
String name)
cert - The certificate to check.name - The name to search for in the certificate.
public static boolean matchName(X509Certificate cert,
String name)
certSubjectContainsName(X509Certificate, String)
cert - The certificate to check for the common name.name - The common name to check for. This method automatically prefixes the name with "CN="
public static Collection<SignerCertPair> findSignersByName(org.bouncycastle.cms.CMSSignedData signedData,
String name,
Collection<String> excludeNames)
signedData - The signed data to search.name - The name to search for in the list of signers.excludeNames - A list of names to exclude from the list. Because the search uses a simple "contains" search, it is possible for the name parameter
to be a substring of what is requested. The excludeNames contains a super string of the name to remove unwanted names from the returned list. This parameter
may be null;
public static X509Certificate findCertByName(Collection<X509Certificate> certs,
String name)
certs - The collection of certificates to search.name - The name to search for in the collection.
public static SignerCertPair findSignerByCert(org.bouncycastle.cms.CMSSignedData signedData,
X509Certificate searchCert)
signedData - The signed data to search.name - The certificate to search for in the signed data.
public static String getSubjectAddress(X509Certificate certificate)
certificate - The certificate to search
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||