Example usage for org.bouncycastle.asn1.nist NISTObjectIdentifiers id_aes192_CBC

List of usage examples for org.bouncycastle.asn1.nist NISTObjectIdentifiers id_aes192_CBC

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.nist NISTObjectIdentifiers id_aes192_CBC.

Prototype

ASN1ObjectIdentifier id_aes192_CBC

To view the source code for org.bouncycastle.asn1.nist NISTObjectIdentifiers id_aes192_CBC.

Click Source Link

Document

2.16.840.1.101.3.4.1.22

Usage

From source file:org.xwiki.crypto.password.internal.pbe.factory.BcPBES2AesCipherFactory.java

License:Open Source License

private int getAESKeySize(ASN1ObjectIdentifier algId) {
    if (algId.equals(NISTObjectIdentifiers.id_aes128_CBC)) {
        return 16;
    } else if (algId.equals(NISTObjectIdentifiers.id_aes192_CBC)) {
        return 24;
    } else if (algId.equals(NISTObjectIdentifiers.id_aes256_CBC)) {
        return 32;
    }//  ww  w  .ja  v  a 2s.c o  m
    throw new IllegalArgumentException(
            "Unexpected algorithm identifier used for PBES2 AES encryption scheme: " + algId.toString());
}

From source file:org.xwiki.crypto.password.internal.pbe.factory.BcPBES2AesCipherFactory.java

License:Open Source License

private ASN1ObjectIdentifier getAESAlgoritmIdentifier(int keySize) {
    switch (keySize) {
    case 16://from ww w  . ja v a 2s . c om
        return NISTObjectIdentifiers.id_aes128_CBC;
    case 24:
        return NISTObjectIdentifiers.id_aes192_CBC;
    case 32:
        return NISTObjectIdentifiers.id_aes256_CBC;
    default:
        throw new IllegalArgumentException(
                "Unexpected key size used for PBES2 AES encryption scheme: " + keySize);
    }
}