本文整理汇总了Java中org.bouncycastle.util.Strings.toLowerCase方法的典型用法代码示例。如果您正苦于以下问题:Java Strings.toLowerCase方法的具体用法?Java Strings.toLowerCase怎么用?Java Strings.toLowerCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.util.Strings
的用法示例。
在下文中一共展示了Strings.toLowerCase方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canonicalize
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
private String canonicalize(String s)
{
String value = Strings.toLowerCase(s.trim());
if (value.length() > 0 && value.charAt(0) == '#')
{
ASN1Primitive obj = decodeObject(value);
if (obj instanceof ASN1String)
{
value = Strings.toLowerCase(((ASN1String)obj).getString().trim());
}
}
return value;
}
示例2: canonicalize
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public static String canonicalize(String s)
{
String value = Strings.toLowerCase(s.trim());
if (value.length() > 0 && value.charAt(0) == '#')
{
ASN1Primitive obj = decodeObject(value);
if (obj instanceof ASN1String)
{
value = Strings.toLowerCase(((ASN1String)obj).getString().trim());
}
}
value = stripInternalSpaces(value);
return value;
}
示例3: equivalentStrings
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
private boolean equivalentStrings(String s1, String s2)
{
String value = Strings.toLowerCase(s1.trim());
String oValue = Strings.toLowerCase(s2.trim());
if (!value.equals(oValue))
{
value = stripInternalSpaces(value);
oValue = stripInternalSpaces(oValue);
if (!value.equals(oValue))
{
return false;
}
}
return true;
}
示例4: convertHexEncoded
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
/**
* Convert an inline encoded hex string rendition of an ASN.1
* object back into its corresponding ASN.1 object.
*
* @param str the hex encoded object
* @param off the index at which the encoding starts
* @return the decoded object
*/
protected ASN1Primitive convertHexEncoded(
String str,
int off)
throws IOException
{
str = Strings.toLowerCase(str);
byte[] data = new byte[(str.length() - off) / 2];
for (int index = 0; index != data.length; index++)
{
char left = str.charAt((index * 2) + off);
char right = str.charAt((index * 2) + off + 1);
if (left < 'a')
{
data[index] = (byte)((left - '0') << 4);
}
else
{
data[index] = (byte)((left - 'a' + 10) << 4);
}
if (right < 'a')
{
data[index] |= (byte)(right - '0');
}
else
{
data[index] |= (byte)(right - 'a' + 10);
}
}
ASN1InputStream aIn = new ASN1InputStream(data);
return aIn.readObject();
}
示例5: calculateMask
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
private int calculateMask(
String actions)
{
StringTokenizer tok = new StringTokenizer(Strings.toLowerCase(actions), " ,");
int mask = 0;
while (tok.hasMoreTokens())
{
String s = tok.nextToken();
if (s.equals(THREAD_LOCAL_EC_IMPLICITLY_CA_STR))
{
mask |= THREAD_LOCAL_EC_IMPLICITLY_CA;
}
else if (s.equals(EC_IMPLICITLY_CA_STR))
{
mask |= EC_IMPLICITLY_CA;
}
else if (s.equals(THREAD_LOCAL_DH_DEFAULT_PARAMS_STR))
{
mask |= THREAD_LOCAL_DH_DEFAULT_PARAMS;
}
else if (s.equals(DH_DEFAULT_PARAMS_STR))
{
mask |= DH_DEFAULT_PARAMS;
}
else if (s.equals(ALL_STR))
{
mask |= ALL;
}
}
if (mask == 0)
{
throw new IllegalArgumentException("unknown permissions passed to mask");
}
return mask;
}
示例6: put
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public void put(String key, Object value)
{
String lower = (key == null) ? null : Strings.toLowerCase(key);
String k = (String)keys.get(lower);
if (k != null)
{
orig.remove(k);
}
keys.put(lower, key);
orig.put(key, value);
}
示例7: convertHexEncoded
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
/**
* Convert an inline encoded hex string rendition of an ASN.1
* object back into its corresponding ASN.1 object.
*
* @param str the hex encoded object
* @param off the index at which the encoding starts
* @return the decoded object
*/
protected DERObject convertHexEncoded(
String str,
int off)
throws IOException
{
str = Strings.toLowerCase(str);
byte[] data = new byte[(str.length() - off) / 2];
for (int index = 0; index != data.length; index++)
{
char left = str.charAt((index * 2) + off);
char right = str.charAt((index * 2) + off + 1);
if (left < 'a')
{
data[index] = (byte)((left - '0') << 4);
}
else
{
data[index] = (byte)((left - 'a' + 10) << 4);
}
if (right < 'a')
{
data[index] |= (byte)(right - '0');
}
else
{
data[index] |= (byte)(right - 'a' + 10);
}
}
ASN1InputStream aIn = new ASN1InputStream(data);
return aIn.readObject();
}
示例8: defineCurveWithOID
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static void defineCurveWithOID(String name, ASN1ObjectIdentifier oid, X9ECParametersHolder holder)
{
names.addElement(name);
oidToName.put(oid, name);
oidToCurve.put(oid, holder);
name = Strings.toLowerCase(name);
nameToOID.put(name, oid);
nameToCurve.put(name, holder);
}
示例9: defineCurveAlias
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static void defineCurveAlias(String name, ASN1ObjectIdentifier oid)
{
Object curve = oidToCurve.get(oid);
if (curve == null)
{
throw new IllegalStateException();
}
name = Strings.toLowerCase(name);
nameToOID.put(name, oid);
nameToCurve.put(name, curve);
}
示例10: canonicalize
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
public static String canonicalize(String s)
{
String value = Strings.toLowerCase(s);
if (value.length() > 0 && value.charAt(0) == '#')
{
ASN1Primitive obj = decodeObject(value);
if (obj instanceof ASN1String)
{
value = Strings.toLowerCase(((ASN1String)obj).getString());
}
}
if (value.length() > 1)
{
int start = 0;
while (start + 1 < value.length() && value.charAt(start) == '\\' && value.charAt(start + 1) == ' ')
{
start += 2;
}
int end = value.length() - 1;
while (end - 1 > 0 && value.charAt(end - 1) == '\\' && value.charAt(end) == ' ')
{
end -= 2;
}
if (start > 0 || end < value.length() - 1)
{
value = value.substring(start, end + 1);
}
}
value = stripInternalSpaces(value);
return value;
}
示例11: defineCurve
import org.bouncycastle.util.Strings; //导入方法依赖的package包/类
static void defineCurve(String name, X9ECParametersHolder holder)
{
names.addElement(name);
name = Strings.toLowerCase(name);
nameToCurve.put(name, holder);
}