public class PkinitCrypto extends Object
| Constructor and Description |
|---|
PkinitCrypto() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kerby.x509.type.Certificate |
changeToCertificate(X509Certificate x509Certificate)
Change the X509Certificate to Certificate
|
static boolean |
checkDHWellknown(PkinitPlgCryptoContext cryptoctx,
org.apache.kerby.x509.type.DhParameter dhParameter,
int dhPrimeBits)
Check DH wellknown
|
static byte[] |
cmsSignedDataCreate(byte[] data,
String oid,
int version,
org.apache.kerby.cms.type.DigestAlgorithmIdentifiers digestAlgorithmIdentifiers,
org.apache.kerby.cms.type.CertificateSet certificateSet,
org.apache.kerby.cms.type.RevocationInfoChoices crls,
org.apache.kerby.cms.type.SignerInfos signerInfos)
RFC4556: The contentType field of the type ContentInfo
is id-signedData (1.2.840.113549.1.7.2),
and the content field is a SignedData.
|
static X509Certificate[] |
createCertChain(PkinitPlgCryptoContext cryptoContext) |
static DHPublicKey |
createDHPublicKey(BigInteger p,
BigInteger g,
BigInteger y)
Create DH public key
|
static org.apache.kerby.asn1.type.Asn1ObjectIdentifier |
createOid(String content)
Create oid
|
static List<PrincipalName> |
cryptoRetrieveCertSans(List<org.apache.kerby.x509.type.Certificate> certificates) |
static List<PrincipalName> |
cryptoRetrieveX509Sans(List<org.apache.kerby.x509.type.Certificate> certificates) |
static byte[] |
eContentInfoCreate(byte[] data,
String oid) |
static boolean |
pkinitCheckDhParams(DHParameterSpec dh1,
org.apache.kerby.x509.type.DhParameter dh2)
Check parameters against a well-known DH group
|
static String |
pkinitType2OID(CmsMessageType cmsMsgType)
Change the CMS message type to oid
|
static void |
serverCheckDH(PluginOpts pluginOpts,
PkinitPlgCryptoContext cryptoctx,
org.apache.kerby.x509.type.DhParameter dhParameter)
KDC check the key parameter
|
static void |
validateChain(List<org.apache.kerby.x509.type.Certificate> certificateList,
org.apache.kerby.x509.type.Certificate anchor)
Validates a chain of
X509Certificates. |
static void |
verifyCmsSignedData(CmsMessageType cmsMsgType,
org.apache.kerby.cms.type.SignedData signedData)
Verify CMS Signed Data
|
static boolean |
verifyKdcSan(String hostname,
PrincipalName kdcPrincipal,
List<org.apache.kerby.x509.type.Certificate> certificates) |
public static void verifyCmsSignedData(CmsMessageType cmsMsgType, org.apache.kerby.cms.type.SignedData signedData) throws KrbException
cmsMsgType - The CMS message typesignedData - The signed dataKrbException - epublic static String pkinitType2OID(CmsMessageType cmsMsgType)
cmsMsgType - The CMS message typepublic static void serverCheckDH(PluginOpts pluginOpts, PkinitPlgCryptoContext cryptoctx, org.apache.kerby.x509.type.DhParameter dhParameter) throws KrbException
pluginOpts - The PluginOptscryptoctx - The PkinitPlgCryptoContextdhParameter - The DhParameterKrbException - epublic static boolean checkDHWellknown(PkinitPlgCryptoContext cryptoctx, org.apache.kerby.x509.type.DhParameter dhParameter, int dhPrimeBits) throws KrbException
cryptoctx - The PkinitPlgCryptoContextdhParameter - The DhParameterdhPrimeBits - The dh prime bitsKrbException - epublic static boolean pkinitCheckDhParams(DHParameterSpec dh1, org.apache.kerby.x509.type.DhParameter dh2)
dh1 - The DHParameterSpecdh2 - The DhParameterpublic static DHPublicKey createDHPublicKey(BigInteger p, BigInteger g, BigInteger y)
p - The prime modulusg - The base generatory - The public valuepublic static byte[] cmsSignedDataCreate(byte[] data,
String oid,
int version,
org.apache.kerby.cms.type.DigestAlgorithmIdentifiers digestAlgorithmIdentifiers,
org.apache.kerby.cms.type.CertificateSet certificateSet,
org.apache.kerby.cms.type.RevocationInfoChoices crls,
org.apache.kerby.cms.type.SignerInfos signerInfos)
throws KrbException
data - The dataoid - The oid for eContentTypeversion - The SignedData versiondigestAlgorithmIdentifiers - The digest algorithmIdentifierscertificateSet - The certificate setcrls - The revocation info choicessignerInfos - The signerInfosKrbException - epublic static byte[] eContentInfoCreate(byte[] data,
String oid)
throws KrbException
KrbExceptionpublic static X509Certificate[] createCertChain(PkinitPlgCryptoContext cryptoContext) throws CertificateNotYetValidException, CertificateExpiredException
public static boolean verifyKdcSan(String hostname, PrincipalName kdcPrincipal, List<org.apache.kerby.x509.type.Certificate> certificates) throws KrbException
KrbExceptionpublic static List<PrincipalName> cryptoRetrieveCertSans(List<org.apache.kerby.x509.type.Certificate> certificates) throws KrbException
KrbExceptionpublic static List<PrincipalName> cryptoRetrieveX509Sans(List<org.apache.kerby.x509.type.Certificate> certificates) throws KrbException
KrbExceptionpublic static void validateChain(List<org.apache.kerby.x509.type.Certificate> certificateList, org.apache.kerby.x509.type.Certificate anchor) throws CertificateException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException, CertPathValidatorException
X509Certificates.certificateList - The certificate listanchor - The anchorCertificateException - eNoSuchAlgorithmException - eInvalidAlgorithmParameterException - eCertPathValidatorException - eNoSuchProviderExceptionpublic static org.apache.kerby.asn1.type.Asn1ObjectIdentifier createOid(String content) throws KrbException
content - The hex contentKrbException - epublic static org.apache.kerby.x509.type.Certificate changeToCertificate(X509Certificate x509Certificate)
x509Certificate - The X509CertificateCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.