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 Detail

      • 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

        CertificateDetails getCertificateFileDetails​(InputStream is,
                                                     KeyStoreScope scope)
                                              throws IOException,
                                                     FcCertificateManagementException
        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)
      • 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