java.lang.Object
nl.altindag.desidero.CertificateUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <T extends Certificate>
StringgenerateAlias(T certificate) private static booleanisP7bFormatted(String certificateContent) private static booleanisPemFormatted(String certificateContent) (package private) static List<Certificate> loadCertificate(Path path) Loads certificates from the filesystem and maps it into a list ofCertificate.private static <T> List<Certificate> loadCertificate(Function<T, InputStream> resourceMapper, T[] resources) private static List<Certificate> parseCertificate(InputStream certificateStream) Tries to map the InputStream to a list ofCertificate.private static List<Certificate> parseCertificate(Matcher certificateMatcher) (package private) static List<Certificate> parseDerCertificate(InputStream certificateStream) (package private) static List<Certificate> parseP7bCertificate(String certificateContent) Parses P7B formatted certificates containing a header as -----BEGIN PKCS7----- and footer as -----END PKCS7----- with a base64 encoded data between the header and footer.(package private) static List<Certificate> parsePemCertificate(String certificateContent) Parses PEM formatted certificates containing a header as -----BEGIN CERTIFICATE----- and footer as -----END CERTIFICATE----- or header as -----BEGIN PKCS7----- and footer as -----END PKCS7----- with a base64 encoded data between the header and footer.
-
Field Details
-
CERTIFICATE_TYPE
- See Also:
-
P7B_HEADER
- See Also:
-
P7B_FOOTER
- See Also:
-
PEM_HEADER
- See Also:
-
PEM_FOOTER
- See Also:
-
PEM_PATTERN
-
P7B_PATTERN
-
EMPTY
- See Also:
-
-
Constructor Details
-
CertificateUtils
private CertificateUtils()
-
-
Method Details
-
generateAlias
-
loadCertificate
Loads certificates from the filesystem and maps it into a list ofCertificate.
Supported input format: PEM, P7B and DER -
loadCertificate
private static <T> List<Certificate> loadCertificate(Function<T, InputStream> resourceMapper, T[] resources) -
parseCertificate
Tries to map the InputStream to a list ofCertificate. It assumes that the content of the InputStream is either PEM, P7B or DER. The InputStream will copied into an OutputStream so it can be read multiple times. -
isPemFormatted
-
isP7bFormatted
-
parsePemCertificate
Parses PEM formatted certificates containing a header as -----BEGIN CERTIFICATE----- and footer as -----END CERTIFICATE----- or header as -----BEGIN PKCS7----- and footer as -----END PKCS7----- with a base64 encoded data between the header and footer. -
parseP7bCertificate
Parses P7B formatted certificates containing a header as -----BEGIN PKCS7----- and footer as -----END PKCS7----- with a base64 encoded data between the header and footer. -
parseCertificate
-
parseDerCertificate
-