public class X509CertUtils extends Object
| Constructor and Description |
|---|
X509CertUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
extractCn(X509Certificate cert)
extractCn returns CN portion of the Subject DN of the certificate
|
static String |
extractCn(X509Certificate[] certs)
extractCn is a helper function to extract the Subject CN from the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static String |
extractHostname(X509Certificate cert)
extractHostname returns the hostname found in the athenz://hostname SanURI entry
|
static String |
extractIssuerCn(X509Certificate cert)
extractIssuerCn returns the CN portion of the Issuer DN from the certificate passed in
|
static String |
extractIssuerCn(X509Certificate[] certs)
extractIssuerCn is a helper function to extract the Issuer CN from the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static String |
extractIssuerDn(X509Certificate cert)
extractIssuerDn returns the IssuerDN from the certificate passed in
|
static String |
extractIssuerDn(X509Certificate[] certs)
extractIssuerDn is a helper function to extract the Issuer DN from the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static String |
extractItemFromURI(List<String> uriList,
String item) |
static String |
extractKeyModulus(X509Certificate cert)
extractKeyModulus returns the modulus for the RSA public key in the certificate
|
static String |
extractKeyModulus(X509Certificate[] certs)
extractKeyModulus is a helper function to extract the Key Modulus CN from the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static String |
extractProvider(X509Certificate cert)
extractProvider derives the provider from athenz://instanceid San URI
|
static String |
extractRequestInstanceId(X509Certificate cert) |
static String |
extractRequestInstanceIdFromDnsNames(List<String> dnsNames) |
static String |
extractRequestInstanceIdFromURI(List<String> uriList) |
static String |
extractSubjectDn(X509Certificate cert)
extractSubjectDn returns the DN from the certificate passed in
|
static String |
extractSubjectDn(X509Certificate[] certs)
extracSubjectDn is a helper function to extract the Subject DN from the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static String |
hexKeyMod(X509Certificate[] certs,
boolean toUpperCase)
hexKeyMod returns the HEX encoded string of SHA256 of the Key Modulus of the leaf certificate
present at the zeroth position in javax.servlet.request.X509Certificate
|
static void |
logCert(org.slf4j.Logger certLogger,
com.yahoo.athenz.auth.Principal principal,
String ip,
String provider,
String instanceId,
X509Certificate x509Cert) |
static String |
logRecord(com.yahoo.athenz.auth.Principal principal,
String ip,
String provider,
String instanceId,
X509Certificate x509Cert) |
static void |
logSSH(org.slf4j.Logger certLogger,
com.yahoo.athenz.auth.Principal principal,
String ip,
String service,
String instanceId) |
public static String extractRequestInstanceIdFromURI(List<String> uriList)
public static String extractProvider(X509Certificate cert)
cert - X509Certificatepublic static String extractRequestInstanceIdFromDnsNames(List<String> dnsNames)
public static String extractHostname(X509Certificate cert)
cert - X509Certficatepublic static String extractRequestInstanceId(X509Certificate cert)
public static String extractKeyModulus(X509Certificate[] certs)
certs - an array of X509Certificatepublic static String extractKeyModulus(X509Certificate cert)
cert - X509Certificate to extract the key modulus frompublic static String extractSubjectDn(X509Certificate[] certs)
certs - an array of X509Certificatepublic static String extractSubjectDn(X509Certificate cert)
cert - X509Certificate to extract the Subject DN frompublic static String extractCn(X509Certificate[] certs)
certs - an array of X509Certificatepublic static String extractCn(X509Certificate cert)
cert - X509Certificate to extract the CN frompublic static String extractIssuerDn(X509Certificate[] certs)
certs - an array of X509Certificatepublic static String extractIssuerDn(X509Certificate cert)
cert - X509Certificate to extract the DN frompublic static String extractIssuerCn(X509Certificate[] certs)
certs - an array of X509Certificatepublic static String extractIssuerCn(X509Certificate cert)
cert - X509Certificate to extract the Issuer CN frompublic static String hexKeyMod(X509Certificate[] certs, boolean toUpperCase)
certs - an array of X509CertificatetoUpperCase - to indicate whether the hex encoded result should be upper case or notpublic static void logCert(org.slf4j.Logger certLogger,
com.yahoo.athenz.auth.Principal principal,
String ip,
String provider,
String instanceId,
X509Certificate x509Cert)
public static void logSSH(org.slf4j.Logger certLogger,
com.yahoo.athenz.auth.Principal principal,
String ip,
String service,
String instanceId)
public static String logRecord(com.yahoo.athenz.auth.Principal principal, String ip, String provider, String instanceId, X509Certificate x509Cert)
Copyright © 2016–2022 Yahoo Inc.. All rights reserved.