Class CryptoFileAnalyzerImpl
java.lang.Object
de.xima.fc.certificate.mgmt.internal.CryptoFileAnalyzerImpl
- All Implemented Interfaces:
CryptoFileAnalyzer
- Since:
- 30.01.26
- Author:
- Norman Lorenz
-
Method Summary
Modifier and TypeMethodDescriptiondetectFileFormat(InputStream is, char[] password) Detects the file format of a file containing cryptographic credentials.getCertificateFileDetails(InputStream is, KeyStoreScope scope) Based on the defined extensions for an X.509 certificate, this method will return the details of a file based certificate, including a comprehensive summary of the certificate's usage information.getKeyStoreLayout(InputStream is, char[] keyStorePassword, KeyStoreScope scope) Provides a map of the KeyStore layout, i.e. the aliases and types of the entries in the KeyStore.validateKeyStoreEntryPasswords(InputStream is, char[] keyStorePassword, Map<String, char[]> keyStoreEntryPasswords) Checks the passwords of the keystore entries in the provided keystore file.
-
Method Details
-
detectFileFormat
Description copied from interface:CryptoFileAnalyzerDetects the file format of a file containing cryptographic credentials.- Specified by:
detectFileFormatin interfaceCryptoFileAnalyzer- Parameters:
is- the input stream containing the file datapassword- the password to decrypt the file (if applicable, could be null)- Returns:
- the detected file format
- Throws:
IOException- if an I/O error occurs during detection
-
getCertificateFileDetails
public CertificateDetails getCertificateFileDetails(InputStream is, KeyStoreScope scope) throws IOException, FcCertificateManagementException Description copied from interface:CryptoFileAnalyzerBased on the defined extensions for an X.509 certificate, this method will return the details of a file based certificate, including a comprehensive summary of the certificate's usage information. This includes the certificate's key usage and extended key usage.- Specified by:
getCertificateFileDetailsin interfaceCryptoFileAnalyzer- Parameters:
is- the input stream containing the certificate datascope- The keystore scope the user is operating at.- Returns:
- a
CertificateDetailsobject containing the details of the certificate - Throws:
IOException- if an I/O error occurs during processingFcCertificateManagementException- if an error occurs while processing the certificate (e.g., invalid format provided)
-
getKeyStoreLayout
public List<KeyStoreEntryDetails> getKeyStoreLayout(InputStream is, char[] keyStorePassword, KeyStoreScope scope) throws IOException, FcCertificateManagementException Description copied from interface:CryptoFileAnalyzerProvides a map of the KeyStore layout, i.e. the aliases and types of the entries in the KeyStore.- Specified by:
getKeyStoreLayoutin interfaceCryptoFileAnalyzer- Parameters:
is- The input stream to load the KeyStore fromkeyStorePassword- The password for the KeyStorescope- The keystore scope the user is operating at.- Returns:
- A list of
KeyStoreEntryDetailsobjects representing the layout of the KeyStore. - Throws:
FcCertificateManagementException- If an error occurs while loading the KeyStoreIOException
-
validateKeyStoreEntryPasswords
public Map<String,Boolean> validateKeyStoreEntryPasswords(InputStream is, char[] keyStorePassword, Map<String, char[]> keyStoreEntryPasswords) throws FcCertificateManagementExceptionDescription copied from interface:CryptoFileAnalyzerChecks the passwords of the keystore entries in the provided keystore file.- Specified by:
validateKeyStoreEntryPasswordsin interfaceCryptoFileAnalyzer- Parameters:
is- the input stream containing the keystore datakeyStorePassword- the password for the keystorekeyStoreEntryPasswords- a map of entry aliases to their respective passwords- Returns:
- a map of entry aliases to boolean values indicating whether the password is correct
- Throws:
FcCertificateManagementException- if an error occurs while validating the passwords
-