Interface CryptoProvider
public interface CryptoProvider
- Since:
- 09.04.25
- Author:
- tobias
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional<CertificateBundle> getCertificateBundleById(Long certificateId, CertificateProviderUser user) Retrieves the certificate bundle for the given certificate ID.@NotNull Optional<CertificateBundle> getCurrentValidCertificateBundleForSubject(CertificateSelectionBySubjectQuery query, CertificateProviderUser user) Retrieves the current valid certificate bundle for the given subject for the specified client.@NotNull Optional<CertificateBundle> getCurrentValidCertificateBundleForUsageSubject(CertificateSelectionByUsageSubjectQuery query, CertificateProviderUser user) Retrieves the current valid certificate bundle for the given usage subject within the specified scope.static CryptoProviderRetrieves the singleton instance of theCryptoProvider.
-
Method Details
-
getInstance
Retrieves the singleton instance of theCryptoProvider. This method uses CDI to obtain the instance.- Returns:
- The singleton instance of the
CryptoProvider.
-
getCertificateBundleById
@NotNull @NotNull Optional<CertificateBundle> getCertificateBundleById(Long certificateId, CertificateProviderUser user) throws FcCertificateProviderException Retrieves the certificate bundle for the given certificate ID. The bundle contains the X.509 certificate and the corresponding private key, if available and the user has permission to access it.- Parameters:
certificateId- the ID of the certificate to retrieve.user- the user requesting the certificate, used for permission checks.- Returns:
- an
Optionalcontaining theCertificateBundleobject if the certificate exists. - Throws:
FcCertificateProviderException- if an error occurs while retrieving the certificate.
-
getCurrentValidCertificateBundleForSubject
@NotNull @NotNull Optional<CertificateBundle> getCurrentValidCertificateBundleForSubject(CertificateSelectionBySubjectQuery query, CertificateProviderUser user) throws FcCertificateProviderException Retrieves the current valid certificate bundle for the given subject for the specified client. The bundle contains the X.509 certificate and the corresponding private key, if available.CertificateSelectionBySubjectQuery.isPartialMatch()does not apply in this method; only exact matches are considered.- Parameters:
query- the query containing the subject, selection scope, and optional filters.user- the user requesting the certificate.- Returns:
- an
Optionalcontaining theCertificateBundleobject if the certificate exists. - Throws:
FcCertificateProviderException- if an error occurs while retrieving the certificate.
-
getCurrentValidCertificateBundleForUsageSubject
@NotNull @NotNull Optional<CertificateBundle> getCurrentValidCertificateBundleForUsageSubject(CertificateSelectionByUsageSubjectQuery query, CertificateProviderUser user) throws FcCertificateProviderException Retrieves the current valid certificate bundle for the given usage subject within the specified scope. The bundle contains the X.509 certificate and the corresponding private key, if available.CertificateSelectionByUsageSubjectQuery.isPartialMatch()does not apply in this method; only exact matches are considered.- Parameters:
query- the query containing the usage subject, selection scope, usage type, and optional filters.user- the user requesting the certificate.- Returns:
- an
Optionalcontaining theCertificateBundleobject if the certificate exists. - Throws:
FcCertificateProviderException- if an error occurs while retrieving the certificate.
-