Package de.mtg.jzlint.utils
Class Utils
java.lang.Object
de.mtg.jzlint.utils.Utils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegercalculateSquareRoot(BigInteger number) Square root for BigInteger is implemented in Java 9.static booleancomponentNameIsEmpty(List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> components) static booleancontainsPolicyOID(X509Certificate certificate, String oid) static booleandnsNamesExist(X509Certificate certificate) static Optional<byte[]>getAKIEKeyIdentifier(X509Certificate certificate) getAllAttributeTypesInSubject(X509Certificate certificate) getAllAttributeValuesInIssuer(X509Certificate certificate) getAllAttributeValuesInSubject(X509Certificate certificate) getAllAttributeValuesInSubject(X509Certificate certificate, String oid) static List<org.bouncycastle.asn1.x509.GeneralName>getAllGeneralNames(byte[] encoded) static byte[]getContent(org.bouncycastle.asn1.ASN1BMPString bmpString) static byte[]getContent(org.bouncycastle.asn1.ASN1UTF8String utfString) static byte[]getContent(org.bouncycastle.asn1.ASN1VisibleString visibleString) static byte[]getContent(org.bouncycastle.asn1.x509.GeneralName generalName) static List<org.bouncycastle.asn1.x509.GeneralName>getDNSNames(byte[] encoded) getDNSNames(X509Certificate certificate) static List<org.bouncycastle.asn1.x509.GeneralName>getEmails(byte[] encoded) getEmails(X509Certificate certificate) static List<org.bouncycastle.asn1.ASN1Encodable>getExplicitTextList(X509Certificate certificate) static org.bouncycastle.asn1.x509.GeneralNamesgetGeneralNames(byte[] encoded) getIpAddresses(X509Certificate certificate) static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue>getIssuerDNNameComponent(X509Certificate certificate, String oid) static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue>getIssuerDNNameComponents(X509Certificate certificate) static intgetLowestSetBit(byte input) static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue>getNameComponent(String oid, byte[] encodedDN) getOCSPURL(X509Certificate certificate) static StringgetPublicKeyOID(X509Certificate certificate) static Optional<byte[]>getSKIEKeyIdentifier(X509Certificate certificate) static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue>getSubjectDNNameComponent(X509Certificate certificate, String oid) static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue>getSubjectDNNameComponents(X509Certificate certificate) static List<org.bouncycastle.asn1.x509.GeneralName>getUniformResourceIdentifiers(byte[] encoded) static booleanhasAdobeX509Extensions(X509Certificate certificate) static booleanhasAuthorityInformationAccessExtension(X509Certificate certificate) static booleanhasAuthorityKeyIdentifierExtension(X509Certificate certificate) static booleanhasBasicConstraintsExtension(X509Certificate certificate) static booleanhasCertificatePoliciesExtension(X509Certificate certificate) static booleanhasCRLDPExtension(X509Certificate certificate) static booleanhasDNSNames(X509Certificate certificate) static booleanhasDNSNamesInSANOrSubjectDN(X509Certificate certificate) static booleanhasExtendedKeyUsageExtension(X509Certificate certificate) static booleanhasExtension(X509Certificate certificate, String oid) static booleanhasExtensions(X509Certificate certificate) static booleanhasKeyUsageExtension(X509Certificate certificate) static booleanhasMultiValuedRDNInIssuer(X509Certificate certificate) static booleanhasMultiValuedRDNInSubject(X509Certificate certificate) static booleanhasRSASignatureOID(X509Certificate certificate) static booleanstatic booleanisAuthorityKeyIdentifierExtensionCritical(X509Certificate certificate) static booleanisBasicConstraintsExtensionCritical(X509Certificate certificate) static booleanisCA(X509Certificate certificate) static booleanisCRLDPExtensionCritical(X509Certificate certificate) static booleanisDelegatedOCSPResponderCert(X509Certificate certificate) static booleanisExtendedKeyUsageExtensionCritical(X509Certificate certificate) static booleanisExtensionCritical(X509Certificate certificate, String oid) static booleanisIPAddress(String value) static booleanisIssuerDNEmpty(X509Certificate certificate) static booleanisPublicKeyDSA(X509Certificate certificate) static booleanisPublicKeyECC(X509Certificate certificate) static booleanisPublicKeyEdDSA(X509Certificate certificate) static booleanisPublicKeyRSA(X509Certificate certificate) static booleanisRootCA(X509Certificate certificate) static booleanisSelfSigned(X509Certificate certificate) static booleanisServerAuthCert(X509Certificate certificate) static booleanisSubCA(X509Certificate certificate) static booleanisSubjectDNEmpty(X509Certificate certificate) static booleanisSubscriberCert(X509Certificate certificate) static boolean
-
Field Details
-
TWO
-
ADOBE_TIMESTAMP_OID
- See Also:
-
ADOBE_ARCHIVE_REV_INFO_OID
- See Also:
-
-
Method Details
-
hasExtensions
-
isCA
-
isSelfSigned
-
isRootCA
-
isSubCA
-
isSubscriberCert
-
isServerAuthCert
-
isDelegatedOCSPResponderCert
-
dnsNamesExist
- Throws:
IOException
-
getDNSNames
- Throws:
IOException
-
getEmails
- Throws:
IOException
-
getIpAddresses
- Throws:
IOException
-
getDNSNames
public static List<org.bouncycastle.asn1.x509.GeneralName> getDNSNames(byte[] encoded) throws IOException - Throws:
IOException
-
getEmails
public static List<org.bouncycastle.asn1.x509.GeneralName> getEmails(byte[] encoded) throws IOException - Throws:
IOException
-
getUniformResourceIdentifiers
public static List<org.bouncycastle.asn1.x509.GeneralName> getUniformResourceIdentifiers(byte[] encoded) throws IOException - Throws:
IOException
-
getAllGeneralNames
public static List<org.bouncycastle.asn1.x509.GeneralName> getAllGeneralNames(byte[] encoded) throws IOException - Throws:
IOException
-
getGeneralNames
public static org.bouncycastle.asn1.x509.GeneralNames getGeneralNames(byte[] encoded) throws IOException - Throws:
IOException
-
isPublicKeyECC
-
isPublicKeyEdDSA
-
isPublicKeyRSA
-
isPublicKeyDSA
-
hasDNSNamesInSANOrSubjectDN
- Throws:
IOException
-
hasDNSNames
- Throws:
IOException
-
hasExtension
-
hasBasicConstraintsExtension
-
hasKeyUsageExtension
-
hasExtendedKeyUsageExtension
-
hasAuthorityInformationAccessExtension
-
hasAuthorityKeyIdentifierExtension
-
hasCertificatePoliciesExtension
-
hasCRLDPExtension
-
isExtensionCritical
-
isBasicConstraintsExtensionCritical
-
isAuthorityInformationAccessExtensionCritical
-
isAuthorityKeyIdentifierExtensionCritical
-
isExtendedKeyUsageExtensionCritical
-
isCRLDPExtensionCritical
-
hasMultiValuedRDNInIssuer
public static boolean hasMultiValuedRDNInIssuer(X509Certificate certificate) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
hasMultiValuedRDNInSubject
public static boolean hasMultiValuedRDNInSubject(X509Certificate certificate) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
getAllAttributeValuesInIssuer
public static List<String> getAllAttributeValuesInIssuer(X509Certificate certificate) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
getAllAttributeValuesInSubject
public static List<String> getAllAttributeValuesInSubject(X509Certificate certificate) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
getAllAttributeValuesInSubject
public static List<String> getAllAttributeValuesInSubject(X509Certificate certificate, String oid) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
getAllAttributeTypesInSubject
public static List<String> getAllAttributeTypesInSubject(X509Certificate certificate) throws CertificateEncodingException - Throws:
CertificateEncodingException
-
isValueIn
-
getAKIEKeyIdentifier
-
getSKIEKeyIdentifier
-
getOCSPURL
-
getExplicitTextList
public static List<org.bouncycastle.asn1.ASN1Encodable> getExplicitTextList(X509Certificate certificate) -
getContent
public static byte[] getContent(org.bouncycastle.asn1.x509.GeneralName generalName) throws IOException - Throws:
IOException
-
getContent
- Throws:
IOException
-
getContent
- Throws:
IOException
-
getContent
public static byte[] getContent(org.bouncycastle.asn1.ASN1VisibleString visibleString) throws IOException - Throws:
IOException
-
getIssuerDNNameComponent
public static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> getIssuerDNNameComponent(X509Certificate certificate, String oid) -
getSubjectDNNameComponent
public static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> getSubjectDNNameComponent(X509Certificate certificate, String oid) -
getIssuerDNNameComponents
public static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> getIssuerDNNameComponents(X509Certificate certificate) -
getSubjectDNNameComponents
public static List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> getSubjectDNNameComponents(X509Certificate certificate) -
isIssuerDNEmpty
-
isSubjectDNEmpty
-
getPublicKeyOID
-
getNameComponent
-
componentNameIsEmpty
public static boolean componentNameIsEmpty(List<org.bouncycastle.asn1.x500.AttributeTypeAndValue> components) -
containsPolicyOID
-
isIPAddress
-
getLowestSetBit
public static int getLowestSetBit(byte input) -
hasAdobeX509Extensions
-
calculateSquareRoot
Square root for BigInteger is implemented in Java 9. To keep compatibility to Java 8 a very simple implementation is provided.- Parameters:
number-- Returns:
-
hasRSASignatureOID
-