From 126571a6cd4bc712f1fb42a858639dac8655464a Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 16 May 2023 16:34:57 +0200 Subject: [PATCH] Document ProviderFactory --- .../pgpainless/provider/BouncyCastleProviderFactory.java | 3 +++ .../java/org/pgpainless/provider/ProviderFactory.java | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/provider/BouncyCastleProviderFactory.java b/pgpainless-core/src/main/java/org/pgpainless/provider/BouncyCastleProviderFactory.java index ace5edbe..7169238a 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/provider/BouncyCastleProviderFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/provider/BouncyCastleProviderFactory.java @@ -8,6 +8,9 @@ import java.security.Provider; import org.bouncycastle.jce.provider.BouncyCastleProvider; +/** + * Implementation of {@link ProviderFactory} using a {@link BouncyCastleProvider}. + */ public final class BouncyCastleProviderFactory extends ProviderFactory { private static final Provider provider = new BouncyCastleProvider(); diff --git a/pgpainless-core/src/main/java/org/pgpainless/provider/ProviderFactory.java b/pgpainless-core/src/main/java/org/pgpainless/provider/ProviderFactory.java index 4af67c60..5942b0d5 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/provider/ProviderFactory.java +++ b/pgpainless-core/src/main/java/org/pgpainless/provider/ProviderFactory.java @@ -6,6 +6,14 @@ package org.pgpainless.provider; import java.security.Provider; +/** + * Allow the use of different {@link Provider} implementations to provide cryptographic primitives by setting + * a {@link ProviderFactory} singleton. + * By default, the class is initialized with a {@link BouncyCastleProviderFactory}. + *
+ * To make use of your own custom {@link Provider}, call {@link #setFactory(ProviderFactory)}, passing your + * own custom {@link ProviderFactory} instance. + */ public abstract class ProviderFactory { private static ProviderFactory FACTORY;