예제 #1
0
 public static Asn1Encodable GenerateParameters(DerObjectIdentifier algID, SecureRandom random)
 {
     return(ParameterUtilities.GenerateParameters(algID.Id, random));
 }
예제 #2
0
 private static Asn1OctetString CreateIVOctetString(SecureRandom random, int ivLength)
 {
     return(new DerOctetString(ParameterUtilities.CreateIV(random, ivLength)));
 }
예제 #3
0
 static ParameterUtilities()
 {
     ParameterUtilities.algorithms   = Platform.CreateHashtable();
     ParameterUtilities.basicIVSizes = Platform.CreateHashtable();
     ParameterUtilities.AddAlgorithm("AES", new object[]
     {
         "AESWRAP"
     });
     ParameterUtilities.AddAlgorithm("AES128", new object[]
     {
         "2.16.840.1.101.3.4.2",
         NistObjectIdentifiers.IdAes128Cbc,
         NistObjectIdentifiers.IdAes128Cfb,
         NistObjectIdentifiers.IdAes128Ecb,
         NistObjectIdentifiers.IdAes128Ofb,
         NistObjectIdentifiers.IdAes128Wrap
     });
     ParameterUtilities.AddAlgorithm("AES192", new object[]
     {
         "2.16.840.1.101.3.4.22",
         NistObjectIdentifiers.IdAes192Cbc,
         NistObjectIdentifiers.IdAes192Cfb,
         NistObjectIdentifiers.IdAes192Ecb,
         NistObjectIdentifiers.IdAes192Ofb,
         NistObjectIdentifiers.IdAes192Wrap
     });
     ParameterUtilities.AddAlgorithm("AES256", new object[]
     {
         "2.16.840.1.101.3.4.42",
         NistObjectIdentifiers.IdAes256Cbc,
         NistObjectIdentifiers.IdAes256Cfb,
         NistObjectIdentifiers.IdAes256Ecb,
         NistObjectIdentifiers.IdAes256Ofb,
         NistObjectIdentifiers.IdAes256Wrap
     });
     ParameterUtilities.AddAlgorithm("BLOWFISH", new object[]
     {
         "1.3.6.1.4.1.3029.1.2"
     });
     ParameterUtilities.AddAlgorithm("CAMELLIA", new object[]
     {
         "CAMELLIAWRAP"
     });
     ParameterUtilities.AddAlgorithm("CAMELLIA128", new object[]
     {
         NttObjectIdentifiers.IdCamellia128Cbc,
         NttObjectIdentifiers.IdCamellia128Wrap
     });
     ParameterUtilities.AddAlgorithm("CAMELLIA192", new object[]
     {
         NttObjectIdentifiers.IdCamellia192Cbc,
         NttObjectIdentifiers.IdCamellia192Wrap
     });
     ParameterUtilities.AddAlgorithm("CAMELLIA256", new object[]
     {
         NttObjectIdentifiers.IdCamellia256Cbc,
         NttObjectIdentifiers.IdCamellia256Wrap
     });
     ParameterUtilities.AddAlgorithm("CAST5", new object[]
     {
         "1.2.840.113533.7.66.10"
     });
     ParameterUtilities.AddAlgorithm("CAST6", new object[0]);
     ParameterUtilities.AddAlgorithm("DES", new object[]
     {
         OiwObjectIdentifiers.DesCbc,
         OiwObjectIdentifiers.DesCfb,
         OiwObjectIdentifiers.DesEcb,
         OiwObjectIdentifiers.DesOfb
     });
     ParameterUtilities.AddAlgorithm("DESEDE", new object[]
     {
         "DESEDEWRAP",
         "TDEA",
         OiwObjectIdentifiers.DesEde,
         PkcsObjectIdentifiers.IdAlgCms3DesWrap
     });
     ParameterUtilities.AddAlgorithm("DESEDE3", new object[]
     {
         PkcsObjectIdentifiers.DesEde3Cbc
     });
     ParameterUtilities.AddAlgorithm("GOST28147", new object[]
     {
         "GOST",
         "GOST-28147",
         CryptoProObjectIdentifiers.GostR28147Cbc
     });
     ParameterUtilities.AddAlgorithm("HC128", new object[0]);
     ParameterUtilities.AddAlgorithm("HC256", new object[0]);
     ParameterUtilities.AddAlgorithm("IDEA", new object[]
     {
         "1.3.6.1.4.1.188.7.1.1.2"
     });
     ParameterUtilities.AddAlgorithm("NOEKEON", new object[0]);
     ParameterUtilities.AddAlgorithm("RC2", new object[]
     {
         PkcsObjectIdentifiers.RC2Cbc,
         PkcsObjectIdentifiers.IdAlgCmsRC2Wrap
     });
     ParameterUtilities.AddAlgorithm("RC4", new object[]
     {
         "ARC4",
         "1.2.840.113549.3.4"
     });
     ParameterUtilities.AddAlgorithm("RC5", new object[]
     {
         "RC5-32"
     });
     ParameterUtilities.AddAlgorithm("RC5-64", new object[0]);
     ParameterUtilities.AddAlgorithm("RC6", new object[0]);
     ParameterUtilities.AddAlgorithm("RIJNDAEL", new object[0]);
     ParameterUtilities.AddAlgorithm("SALSA20", new object[0]);
     ParameterUtilities.AddAlgorithm("SEED", new object[]
     {
         KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap,
         KisaObjectIdentifiers.IdSeedCbc
     });
     ParameterUtilities.AddAlgorithm("SERPENT", new object[0]);
     ParameterUtilities.AddAlgorithm("SKIPJACK", new object[0]);
     ParameterUtilities.AddAlgorithm("TEA", new object[0]);
     ParameterUtilities.AddAlgorithm("TWOFISH", new object[0]);
     ParameterUtilities.AddAlgorithm("VMPC", new object[0]);
     ParameterUtilities.AddAlgorithm("VMPC-KSA3", new object[0]);
     ParameterUtilities.AddAlgorithm("XTEA", new object[0]);
     ParameterUtilities.AddBasicIVSizeEntries(8, new string[]
     {
         "BLOWFISH",
         "DES",
         "DESEDE",
         "DESEDE3"
     });
     ParameterUtilities.AddBasicIVSizeEntries(16, new string[]
     {
         "AES",
         "AES128",
         "AES192",
         "AES256",
         "CAMELLIA",
         "CAMELLIA128",
         "CAMELLIA192",
         "CAMELLIA256",
         "NOEKEON",
         "SEED"
     });
 }
예제 #4
0
 public static ICipherParameters GetCipherParameters(DerObjectIdentifier algOid, ICipherParameters key, Asn1Object asn1Params)
 {
     return(ParameterUtilities.GetCipherParameters(algOid.Id, key, asn1Params));
 }
예제 #5
0
 public static KeyParameter CreateKeyParameter(DerObjectIdentifier algOid, byte[] keyBytes, int offset, int length)
 {
     return(ParameterUtilities.CreateKeyParameter(algOid.Id, keyBytes, offset, length));
 }
예제 #6
0
 public static KeyParameter CreateKeyParameter(string algorithm, byte[] keyBytes)
 {
     return(ParameterUtilities.CreateKeyParameter(algorithm, keyBytes, 0, keyBytes.Length));
 }
예제 #7
0
 public static KeyParameter CreateKeyParameter(DerObjectIdentifier algOid, byte[] keyBytes)
 {
     return(ParameterUtilities.CreateKeyParameter(algOid.Id, keyBytes, 0, keyBytes.Length));
 }