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<org.apache.kerby.kerberos.kerb.type.base.PrincipalName> |
cryptoRetrieveCertSans(List<org.apache.kerby.x509.type.Certificate> certificates) |
static List<org.apache.kerby.kerberos.kerb.type.base.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,
X509Certificate 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,
org.apache.kerby.kerberos.kerb.type.base.PrincipalName kdcPrincipal,
List<org.apache.kerby.x509.type.Certificate> certificates) |
public static void verifyCmsSignedData(CmsMessageType cmsMsgType, org.apache.kerby.cms.type.SignedData signedData) throws org.apache.kerby.kerberos.kerb.KrbException
cmsMsgType - The CMS message typesignedData - The signed dataorg.apache.kerby.kerberos.kerb.KrbException - 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 org.apache.kerby.kerberos.kerb.KrbException
pluginOpts - The PluginOptscryptoctx - The PkinitPlgCryptoContextdhParameter - The DhParameterorg.apache.kerby.kerberos.kerb.KrbException - epublic static boolean checkDHWellknown(PkinitPlgCryptoContext cryptoctx, org.apache.kerby.x509.type.DhParameter dhParameter, int dhPrimeBits) throws org.apache.kerby.kerberos.kerb.KrbException
cryptoctx - The PkinitPlgCryptoContextdhParameter - The DhParameterdhPrimeBits - The dh prime bitsorg.apache.kerby.kerberos.kerb.KrbException - 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 org.apache.kerby.kerberos.kerb.KrbException
data - The dataoid - The oid for eContentTypeversion - The SignedData versiondigestAlgorithmIdentifiers - The digest algorithmIdentifierscertificateSet - The certificate setcrls - The revocation info choicessignerInfos - The signerInfosorg.apache.kerby.kerberos.kerb.KrbException - epublic static byte[] eContentInfoCreate(byte[] data,
String oid)
throws org.apache.kerby.kerberos.kerb.KrbException
org.apache.kerby.kerberos.kerb.KrbExceptionpublic static X509Certificate[] createCertChain(PkinitPlgCryptoContext cryptoContext) throws CertificateNotYetValidException, CertificateExpiredException
public static boolean verifyKdcSan(String hostname, org.apache.kerby.kerberos.kerb.type.base.PrincipalName kdcPrincipal, List<org.apache.kerby.x509.type.Certificate> certificates) throws org.apache.kerby.kerberos.kerb.KrbException
org.apache.kerby.kerberos.kerb.KrbExceptionpublic static List<org.apache.kerby.kerberos.kerb.type.base.PrincipalName> cryptoRetrieveCertSans(List<org.apache.kerby.x509.type.Certificate> certificates) throws org.apache.kerby.kerberos.kerb.KrbException
org.apache.kerby.kerberos.kerb.KrbExceptionpublic static List<org.apache.kerby.kerberos.kerb.type.base.PrincipalName> cryptoRetrieveX509Sans(List<org.apache.kerby.x509.type.Certificate> certificates) throws org.apache.kerby.kerberos.kerb.KrbException
org.apache.kerby.kerberos.kerb.KrbExceptionpublic static void validateChain(List<org.apache.kerby.x509.type.Certificate> certificateList, X509Certificate anchor) throws CertificateException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException, CertPathValidatorException, IOException
X509Certificates.certificateList - The certificate listanchor - The anchorCertificateException - eNoSuchAlgorithmException - eInvalidAlgorithmParameterException - eCertPathValidatorException - eIOExceptionNoSuchProviderExceptionpublic static org.apache.kerby.asn1.type.Asn1ObjectIdentifier createOid(String content) throws org.apache.kerby.kerberos.kerb.KrbException
content - The hex contentorg.apache.kerby.kerberos.kerb.KrbException - epublic static org.apache.kerby.x509.type.Certificate changeToCertificate(X509Certificate x509Certificate)
x509Certificate - The X509CertificateCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.