当前位置: 首页>>代码示例>>Java>>正文


Java Strings.toUpperCase方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:X509Util.java

示例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);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:IESCipher.java

示例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");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:IESCipher.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:CipherSpi.java

示例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());
    }
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:21,代码来源:X509Util.java

示例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);
    }
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:21,代码来源:X509Util.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:X509Util.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:33,代码来源:DigestFactory.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:KeyAgreementSpi.java

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:CipherSpi.java

示例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);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:11,代码来源:ProtocolVersion.java

示例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);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:13,代码来源:X509Util.java

示例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;
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:41,代码来源:DigestFactory.java

示例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();
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:16,代码来源:BaseAgreementSpi.java

示例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.");
        }
    }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:58,代码来源:JCEBlockCipher.java


注:本文中的org.bouncycastle.util.Strings.toUpperCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。