add all
This commit is contained in:
53
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/pkcs/PKCS12StoreBuilder.cs
vendored
Normal file
53
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/pkcs/PKCS12StoreBuilder.cs
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
||||
using Best.HTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Pkcs
|
||||
{
|
||||
public class Pkcs12StoreBuilder
|
||||
{
|
||||
private DerObjectIdentifier keyAlgorithm = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc;
|
||||
private DerObjectIdentifier certAlgorithm = PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc;
|
||||
private DerObjectIdentifier keyPrfAlgorithm = null;
|
||||
private bool useDerEncoding = false;
|
||||
|
||||
public Pkcs12StoreBuilder()
|
||||
{
|
||||
}
|
||||
|
||||
public Pkcs12Store Build()
|
||||
{
|
||||
return new Pkcs12Store(keyAlgorithm, keyPrfAlgorithm, certAlgorithm, useDerEncoding);
|
||||
}
|
||||
|
||||
public Pkcs12StoreBuilder SetCertAlgorithm(DerObjectIdentifier certAlgorithm)
|
||||
{
|
||||
this.certAlgorithm = certAlgorithm;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pkcs12StoreBuilder SetKeyAlgorithm(DerObjectIdentifier keyAlgorithm)
|
||||
{
|
||||
this.keyAlgorithm = keyAlgorithm;
|
||||
return this;
|
||||
}
|
||||
|
||||
// Specify a PKCS#5 Scheme 2 encryption for keys
|
||||
public Pkcs12StoreBuilder SetKeyAlgorithm(DerObjectIdentifier keyAlgorithm, DerObjectIdentifier keyPrfAlgorithm)
|
||||
{
|
||||
this.keyAlgorithm = keyAlgorithm;
|
||||
this.keyPrfAlgorithm = keyPrfAlgorithm;
|
||||
return this;
|
||||
}
|
||||
public Pkcs12StoreBuilder SetUseDerEncoding(bool useDerEncoding)
|
||||
{
|
||||
this.useDerEncoding = useDerEncoding;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user