Interface CryptoFileAnalyzer

All Known Implementing Classes:
CryptoFileAnalyzerImpl

public interface CryptoFileAnalyzer
Service for analyzing cryptographic files and data on the master server.
Since:
8.5.0
Author:
Norman Lorenz
  • Method Details

    • getInstance

      static CryptoFileAnalyzer getInstance()
      Returns:
      the singleton instance of CryptoFileAnalyzer. This method uses CDI to obtain the instance, so it should be called within a CDI-managed context.
    • detectFileFormat

      @NotNull @NotNull ECryptoFileFormat detectFileFormat(InputStream is, char[] password) throws IOException
      Detects the file format of a file containing cryptographic credentials.
      Parameters:
      is - the input stream containing the file data
      password - 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

      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. This includes the certificate's key usage and extended key usage.
      Parameters:
      is - the input stream containing the certificate data
      scope - The keystore scope the user is operating at.
      Returns:
      a CertificateDetails object containing the details of the certificate
      Throws:
      IOException - if an I/O error occurs during processing
      FcCertificateManagementException - if an error occurs while processing the certificate (e.g., invalid format provided)
    • getKeyStoreLayout

      List<KeyStoreEntryDetails> getKeyStoreLayout(InputStream is, char[] keyStorePassword, KeyStoreScope scope) throws IOException, FcCertificateManagementException
      Provides a map of the KeyStore layout, i.e. the aliases and types of the entries in the KeyStore.
      Parameters:
      is - The input stream to load the KeyStore from
      keyStorePassword - The password for the KeyStore
      scope - The keystore scope the user is operating at.
      Returns:
      A list of KeyStoreEntryDetails objects representing the layout of the KeyStore.
      Throws:
      FcCertificateManagementException - If an error occurs while loading the KeyStore
      IOException
    • validateKeyStoreEntryPasswords

      Map<String,Boolean> validateKeyStoreEntryPasswords(InputStream is, char[] keyStorePassword, Map<String,char[]> keyStoreEntryPasswords) throws FcCertificateManagementException
      Checks the passwords of the keystore entries in the provided keystore file.
      Parameters:
      is - the input stream containing the keystore data
      keyStorePassword - the password for the keystore
      keyStoreEntryPasswords - 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