本文整理汇总了Java中org.bouncycastle.util.Strings.toUpperCase方法的典型用法代码示例。如果您正苦于以下问题:Java Strings.toUpperCase方法的具体用法?Java Strings.toUpperCase怎么用?Java Strings.toUpperCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.util.Strings
的用法示例。
在下文中一共展示了Strings.toUpperCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSigAlgID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static AlgorithmIdentifier getSigAlgID(
DERObjectIdentifier sigOid,
String algorithmName)
{
if (noParams.contains(sigOid))
{
return new AlgorithmIdentifier(sigOid);
}
algorithmName = Strings.toUpperCase(algorithmName);
if (params.containsKey(algorithmName))
{
return new AlgorithmIdentifier(sigOid, (ASN1Encodable)params.get(algorithmName));
}
else
{
return new AlgorithmIdentifier(sigOid, DERNull.INSTANCE);
}
}
示例2: engineSetMode
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public void engineSetMode(String mode)
throws NoSuchAlgorithmException
{
String modeName = Strings.toUpperCase(mode);
if (modeName.equals("NONE"))
{
dhaesMode = false;
}
else if (modeName.equals("DHAES"))
{
dhaesMode = true;
}
else
{
throw new IllegalArgumentException("can't support mode " + mode);
}
}
示例3: engineSetPadding
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public void engineSetPadding(String padding)
throws NoSuchPaddingException
{
String paddingName = Strings.toUpperCase(padding);
// TDOD: make this meaningful...
if (paddingName.equals("NOPADDING"))
{
}
else if (paddingName.equals("PKCS5PADDING") || paddingName.equals("PKCS7PADDING"))
{
}
else
{
throw new NoSuchPaddingException("padding not available with IESCipher");
}
}
示例4: engineSetMode
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
protected void engineSetMode(
String mode)
throws NoSuchAlgorithmException
{
String md = Strings.toUpperCase(mode);
if (md.equals("NONE") || md.equals("ECB"))
{
return;
}
if (md.equals("1"))
{
privateKeyOnly = true;
publicKeyOnly = false;
return;
}
else if (md.equals("2"))
{
privateKeyOnly = false;
publicKeyOnly = true;
return;
}
throw new NoSuchAlgorithmException("can't support mode " + mode);
}
示例5: getSigAlgID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static AlgorithmIdentifier getSigAlgID(
DERObjectIdentifier sigOid,
String algorithmName)
{
if (noParams.contains(sigOid))
{
return new AlgorithmIdentifier(sigOid);
}
algorithmName = Strings.toUpperCase(algorithmName);
if (params.containsKey(algorithmName))
{
return new AlgorithmIdentifier(sigOid, (DEREncodable)params.get(algorithmName));
}
else
{
return new AlgorithmIdentifier(sigOid, new DERNull());
}
}
示例6: getSigAlgID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static AlgorithmIdentifier getSigAlgID(
ASN1ObjectIdentifier sigOid,
String algorithmName)
{
if (noParams.contains(sigOid))
{
return new AlgorithmIdentifier(sigOid);
}
algorithmName = Strings.toUpperCase(algorithmName);
if (params.containsKey(algorithmName))
{
return new AlgorithmIdentifier(sigOid, (ASN1Encodable)params.get(algorithmName));
}
else
{
return new AlgorithmIdentifier(sigOid, DERNull.INSTANCE);
}
}
示例7: getAlgorithmOID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static DERObjectIdentifier getAlgorithmOID(
String algorithmName)
{
algorithmName = Strings.toUpperCase(algorithmName);
if (algorithms.containsKey(algorithmName))
{
return (DERObjectIdentifier)algorithms.get(algorithmName);
}
return new DERObjectIdentifier(algorithmName);
}
示例8: getDigest
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public static Digest getDigest(
String digestName)
{
digestName = Strings.toUpperCase(digestName);
if (sha1.contains(digestName))
{
return new SHA1Digest();
}
if (md5.contains(digestName))
{
return new MD5Digest();
}
if (sha224.contains(digestName))
{
return new SHA224Digest();
}
if (sha256.contains(digestName))
{
return new SHA256Digest();
}
if (sha384.contains(digestName))
{
return new SHA384Digest();
}
if (sha512.contains(digestName))
{
return new SHA512Digest();
}
return null;
}
示例9: engineGenerateSecret
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
protected SecretKey engineGenerateSecret(
String algorithm)
{
if (x == null)
{
throw new IllegalStateException("Diffie-Hellman not initialised.");
}
String algKey = Strings.toUpperCase(algorithm);
byte[] res = bigIntToBytes(result);
if (algorithms.containsKey(algKey))
{
Integer length = (Integer)algorithms.get(algKey);
byte[] key = new byte[length.intValue() / 8];
System.arraycopy(res, 0, key, 0, key.length);
if (algKey.startsWith("DES"))
{
DESParameters.setOddParity(key);
}
return new SecretKeySpec(key, algorithm);
}
return new SecretKeySpec(res, algorithm);
}
示例10: engineSetMode
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
protected void engineSetMode(
String mode)
throws NoSuchAlgorithmException
{
String md = Strings.toUpperCase(mode);
if (md.equals("NONE") || md.equals("ECB"))
{
return;
}
throw new NoSuchAlgorithmException("can't support mode " + mode);
}
示例11: getUnknownVersion
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
private static ProtocolVersion getUnknownVersion(int major, int minor, String prefix)
throws IOException
{
TlsUtils.checkUint8(major);
TlsUtils.checkUint8(minor);
int v = (major << 8) | minor;
String hex = Strings.toUpperCase(Integer.toHexString(0x10000 | v).substring(1));
return new ProtocolVersion(v, prefix + " 0x" + hex);
}
示例12: getAlgorithmOID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static ASN1ObjectIdentifier getAlgorithmOID(
String algorithmName)
{
algorithmName = Strings.toUpperCase(algorithmName);
if (algorithms.containsKey(algorithmName))
{
return (ASN1ObjectIdentifier)algorithms.get(algorithmName);
}
return new ASN1ObjectIdentifier(algorithmName);
}
示例13: getDigest
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public static Digest getDigest(
String digestName)
{
digestName = Strings.toUpperCase(digestName);
if (sha1.contains(digestName))
{
return new SHA1Digest();
}
if (md5.contains(digestName))
{
return new MD5Digest();
}
if (sha224.contains(digestName))
{
return new SHA224Digest();
}
if (sha256.contains(digestName))
{
return new SHA256Digest();
}
if (sha384.contains(digestName))
{
return new SHA384Digest();
}
if (sha512.contains(digestName))
{
return new SHA512Digest();
}
if (sha512_224.contains(digestName))
{
return new SHA512tDigest(224);
}
if (sha512_256.contains(digestName))
{
return new SHA512tDigest(256);
}
return null;
}
示例14: getKeySize
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
protected static int getKeySize(String algDetails)
{
if (algDetails.indexOf('[') > 0)
{
return (Integer.parseInt(algDetails.substring(algDetails.indexOf('[') + 1, algDetails.indexOf(']'))) + 7) / 8;
}
String algKey = Strings.toUpperCase(algDetails);
if (!keySizes.containsKey(algKey))
{
return -1;
}
return ((Integer)keySizes.get(algKey)).intValue();
}
示例15: engineSetPadding
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
protected void engineSetPadding(
String padding)
throws NoSuchPaddingException
{
String paddingName = Strings.toUpperCase(padding);
if (paddingName.equals("NOPADDING"))
{
if (cipher.wrapOnNoPadding())
{
cipher = new BufferedGenericBlockCipher(new BufferedBlockCipher(cipher.getUnderlyingCipher()));
}
}
else if (paddingName.equals("WITHCTS"))
{
cipher = new BufferedGenericBlockCipher(new CTSBlockCipher(cipher.getUnderlyingCipher()));
}
else
{
padded = true;
if (isAEADModeName(modeName))
{
throw new NoSuchPaddingException("Only NoPadding can be used with AEAD modes.");
}
else if (paddingName.equals("PKCS5PADDING") || paddingName.equals("PKCS7PADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher());
}
/*
else if (paddingName.equals("ZEROBYTEPADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher(), new ZeroBytePadding());
}
else if (paddingName.equals("ISO10126PADDING") || paddingName.equals("ISO10126-2PADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher(), new ISO10126d2Padding());
}
else if (paddingName.equals("X9.23PADDING") || paddingName.equals("X923PADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher(), new X923Padding());
}
else if (paddingName.equals("ISO7816-4PADDING") || paddingName.equals("ISO9797-1PADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher(), new ISO7816d4Padding());
}
else if (paddingName.equals("TBCPADDING"))
{
cipher = new BufferedGenericBlockCipher(cipher.getUnderlyingCipher(), new TBCPadding());
}
*/
else
{
throw new NoSuchPaddingException("Padding " + padding + " unknown.");
}
}
}