package com.oracle.security.ucrypto;
public enum UcryptoMech {
CRYPTO_AES_ECB(new ServiceDesc[]
{ sd("Cipher", "AES/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding"),
sd("Cipher", "AES/ECB/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesEcbPKCS5",
"AES"),
sd("Cipher", "AES_128/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding",
"2.16.840.1.101.3.4.1.1", "OID.2.16.840.1.101.3.4.1.1"),
sd("Cipher", "AES_192/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding",
"2.16.840.1.101.3.4.1.21", "OID.2.16.840.1.101.3.4.1.21"),
sd("Cipher", "AES_256/ECB/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesEcbNoPadding",
"2.16.840.1.101.3.4.1.41", "OID.2.16.840.1.101.3.4.1.41")
}),
CRYPTO_AES_CBC(new ServiceDesc[]
{ sd("Cipher", "AES/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding"),
sd("Cipher", "AES/CBC/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCbcPKCS5"),
sd("Cipher", "AES_128/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding",
"2.16.840.1.101.3.4.1.2", "OID.2.16.840.1.101.3.4.1.2"),
sd("Cipher", "AES_192/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding",
"2.16.840.1.101.3.4.1.22", "OID.2.16.840.1.101.3.4.1.22"),
sd("Cipher", "AES_256/CBC/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCbcNoPadding",
"2.16.840.1.101.3.4.1.42", "OID.2.16.840.1.101.3.4.1.42")
}),
CRYPTO_AES_CTR(new ServiceDesc[]
{ sd("Cipher", "AES/CTR/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCtrNoPadding") }),
CRYPTO_AES_GCM(new ServiceDesc[]
{ sd("Cipher", "AES/GCM/NoPadding", "com.oracle.security.ucrypto.NativeGCMCipher$AesGcmNoPadding"),
sd("Cipher", "AES_128/GCM/NoPadding", "com.oracle.security.ucrypto.NativeGCMCipher$AesGcmNoPadding",
"2.16.840.1.101.3.4.1.6", "OID.2.16.840.1.101.3.4.1.6"),
sd("Cipher", "AES_192/GCM/NoPadding", "com.oracle.security.ucrypto.NativeGCMCipher$AesGcmNoPadding",
"2.16.840.1.101.3.4.1.26", "OID.2.16.840.1.101.3.4.1.26"),
sd("Cipher", "AES_256/GCM/NoPadding", "com.oracle.security.ucrypto.NativeGCMCipher$AesGcmNoPadding",
"2.16.840.1.101.3.4.1.46", "OID.2.16.840.1.101.3.4.1.46")
}),
CRYPTO_AES_CFB128(new ServiceDesc[]
{ sd("Cipher", "AES/CFB128/NoPadding", "com.oracle.security.ucrypto.NativeCipher$AesCfb128NoPadding"),
sd("Cipher", "AES/CFB128/PKCS5Padding", "com.oracle.security.ucrypto.NativeCipherWithJavaPadding$AesCfb128PKCS5")
}),
CRYPTO_RSA_PKCS(new ServiceDesc[]
{ sd("Cipher", "RSA/ECB/PKCS1Padding", "com.oracle.security.ucrypto.NativeRSACipher$PKCS1Padding",
"RSA")
}),
CRYPTO_RSA_X_509(new ServiceDesc[]
{ sd("Cipher", "RSA/ECB/NoPadding", "com.oracle.security.ucrypto.NativeRSACipher$NoPadding") }),
CRYPTO_MD5_RSA_PKCS(new ServiceDesc[]
{ sd("Signature", "MD5withRSA", "com.oracle.security.ucrypto.NativeRSASignature$MD5",
"1.2.840.113549.1.1.4", "OID.1.2.840.113549.1.1.4")
}),
CRYPTO_SHA1_RSA_PKCS(new ServiceDesc[]
{ sd("Signature", "SHA1withRSA", "com.oracle.security.ucrypto.NativeRSASignature$SHA1",
"1.2.840.113549.1.1.5", "OID.1.2.840.113549.1.1.5",
"1.3.14.3.2.29")
}),
CRYPTO_SHA256_RSA_PKCS(new ServiceDesc[]
{ sd("Signature", "SHA256withRSA", "com.oracle.security.ucrypto.NativeRSASignature$SHA256",
"1.2.840.113549.1.1.11", "OID.1.2.840.113549.1.1.11")
}),
CRYPTO_SHA384_RSA_PKCS(new ServiceDesc[]
{ sd("Signature", "SHA384withRSA", "com.oracle.security.ucrypto.NativeRSASignature$SHA384",
"1.2.840.113549.1.1.12", "OID.1.2.840.113549.1.1.12")
}),
CRYPTO_SHA512_RSA_PKCS(new ServiceDesc[]
{ sd("Signature", "SHA512withRSA", "com.oracle.security.ucrypto.NativeRSASignature$SHA512",
"1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13")
}),
CRYPTO_MD5(new ServiceDesc[]
{ sd("MessageDigest", "MD5", "com.oracle.security.ucrypto.NativeDigest$MD5") }),
CRYPTO_SHA1(new ServiceDesc[]
{ sd("MessageDigest", "SHA", "com.oracle.security.ucrypto.NativeDigest$SHA1", "SHA-1", "SHA1") }),
CRYPTO_SHA224(new ServiceDesc[]
{ sd("MessageDigest", "SHA-224", "com.oracle.security.ucrypto.NativeDigest$SHA224",
"2.16.840.1.101.3.4.2.4", "OID.2.16.840.1.101.3.4.2.4")
}),
CRYPTO_SHA256(new ServiceDesc[]
{ sd("MessageDigest", "SHA-256", "com.oracle.security.ucrypto.NativeDigest$SHA256",
"2.16.840.1.101.3.4.2.1", "OID.2.16.840.1.101.3.4.2.1")
}),
CRYPTO_SHA384(new ServiceDesc[]
{ sd("MessageDigest", "SHA-384", "com.oracle.security.ucrypto.NativeDigest$SHA384",
"2.16.840.1.101.3.4.2.2", "OID.2.16.840.1.101.3.4.2.2")
}),
CRYPTO_SHA512(new ServiceDesc[]
{ sd("MessageDigest", "SHA-512", "com.oracle.security.ucrypto.NativeDigest$SHA512",
"2.16.840.1.101.3.4.2.3", "OID.2.16.840.1.101.3.4.2.3")
}),
CRYPTO_SHA3_224(new ServiceDesc[]
{ sd("MessageDigest", "SHA3-224", "com.oracle.security.ucrypto.NativeDigest$SHA3_224",
"2.16.840.1.101.3.4.2.7", "OID.2.16.840.1.101.3.4.2.7")
}),
CRYPTO_SHA3_256(new ServiceDesc[]
{ sd("MessageDigest", "SHA3-256", "com.oracle.security.ucrypto.NativeDigest$SHA3_256",
"2.16.840.1.101.3.4.2.8", "OID.2.16.840.1.101.3.4.2.8")
}),
CRYPTO_SHA3_384(new ServiceDesc[]
{ sd("MessageDigest", "SHA3-384", "com.oracle.security.ucrypto.NativeDigest$SHA3_384",
"2.16.840.1.101.3.4.2.9", "OID.2.16.840.1.101.3.4.2.9")
}),
CRYPTO_SHA3_512(new ServiceDesc[]
{ sd("MessageDigest", "SHA3-512", "com.oracle.security.ucrypto.NativeDigest$SHA3_512",
"2.16.840.1.101.3.4.2.10", "OID.2.16.840.1.101.3.4.2.10")
});
private int mech = 0;
private final ServiceDesc[] serviceDescs;
private static ServiceDesc sd(String type, String algo, String cn, String... aliases) {
return new ServiceDesc(type, algo, cn, aliases);
}
UcryptoMech(ServiceDesc[] serviceDescs) {
this.serviceDescs = serviceDescs;
}
public void setValue(int nativeMechValue) {
this.mech = nativeMechValue;
}
public int value() { return mech; }
public ServiceDesc[] getServiceDescriptions() { return serviceDescs; }
}