40 lines
1.6 KiB
Java
40 lines
1.6 KiB
Java
package org.bouncycastle.jce.provider;
|
|
|
|
import java.security.cert.TrustAnchor;
|
|
import java.security.cert.X509CRL;
|
|
import java.security.cert.X509Certificate;
|
|
import javax.security.auth.x500.X500Principal;
|
|
import org.bouncycastle.asn1.x500.X500Name;
|
|
import org.bouncycastle.x509.X509AttributeCertificate;
|
|
|
|
/* loaded from: classes6.dex */
|
|
class PrincipalUtils {
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X500Name getSubjectPrincipal(X509Certificate x509Certificate) {
|
|
return X500Name.getInstance(x509Certificate.getSubjectX500Principal().getEncoded());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X500Name getIssuerPrincipal(X509Certificate x509Certificate) {
|
|
return X500Name.getInstance(x509Certificate.getIssuerX500Principal().getEncoded());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X500Name getIssuerPrincipal(X509CRL x509crl) {
|
|
return X500Name.getInstance(x509crl.getIssuerX500Principal().getEncoded());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X500Name getEncodedIssuerPrincipal(Object obj) {
|
|
return obj instanceof X509Certificate ? getIssuerPrincipal((X509Certificate) obj) : X500Name.getInstance(((X500Principal) ((X509AttributeCertificate) obj).getIssuer().getPrincipals()[0]).getEncoded());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static X500Name getCA(TrustAnchor trustAnchor) {
|
|
return X500Name.getInstance(trustAnchor.getCA().getEncoded());
|
|
}
|
|
|
|
PrincipalUtils() {
|
|
}
|
|
}
|