1package org.bouncycastle.jcajce.provider.config;
2
3import java.io.OutputStream;
4import java.security.KeyStore;
5import java.security.KeyStore.LoadStoreParameter;
6import java.security.KeyStore.ProtectionParameter;
7
8public class PKCS12StoreParameter
9    implements LoadStoreParameter
10{
11    private final OutputStream out;
12    private final ProtectionParameter protectionParameter;
13    private final boolean forDEREncoding;
14
15    public PKCS12StoreParameter(OutputStream out, char[] password)
16    {
17        this(out, password, false);
18    }
19
20    public PKCS12StoreParameter(OutputStream out, ProtectionParameter protectionParameter)
21    {
22        this(out, protectionParameter, false);
23    }
24
25    public PKCS12StoreParameter(OutputStream out, char[] password, boolean forDEREncoding)
26    {
27        this(out, new KeyStore.PasswordProtection(password), forDEREncoding);
28    }
29
30    public PKCS12StoreParameter(OutputStream out, ProtectionParameter protectionParameter, boolean forDEREncoding)
31    {
32        this.out = out;
33        this.protectionParameter = protectionParameter;
34        this.forDEREncoding = forDEREncoding;
35    }
36
37    public OutputStream getOutputStream()
38    {
39        return out;
40    }
41
42    public ProtectionParameter getProtectionParameter()
43    {
44        return protectionParameter;
45    }
46
47    public boolean isForDEREncoding()
48    {
49        return forDEREncoding;
50    }
51}
52