/** * return the object identifier signified by the passed in name. Null * if there is no object identifier associated with name. * * @return the object identifier associated with name, if present. */ public static ASN1ObjectIdentifier getOID( String name) { return (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); }
public static boolean isDES(String algorithmID) { String name = Strings.toUpperCase(algorithmID); return des.contains(name); }
/** * return the object identifier signified by the passed in name. Null * if there is no object identifier associated with name. * * @return the object identifier associated with name, if present. */ public static ASN1ObjectIdentifier getOID( String name) { return (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); }
private static void addSBox(String sBoxName, byte[] sBox) { sBoxes.put(Strings.toUpperCase(sBoxName), sBox); }
protected void bindDevice(Device device){ mDeviceLabel.setText(Strings.toUpperCase(device.device)); mIdLabel.setText(Strings.toUpperCase(device.id)); }
private static void addSBox(String sBoxName, byte[] sBox) { sBoxes.put(Strings.toUpperCase(sBoxName), sBox); }
@Override protected void onBind(@Nullable Object obj) { mTitleLabel.setText(Strings.toUpperCase("Local Devices")); } }
@Override protected void onBind(@Nullable Object obj) { mTitleLabel.setText(Strings.toUpperCase("Remote Devices")); } }
public void engineSetMode(String mode) throws NoSuchAlgorithmException { String modeName = Strings.toUpperCase(mode); if (!modeName.equals("NONE")) { throw new IllegalArgumentException("can't support mode " + mode); } }
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); }
protected static int getKeySize(String algDetails) { if (algDetails.indexOf('[') > 0) { return Integer.parseInt(algDetails.substring(algDetails.indexOf('[') + 1, algDetails.indexOf(']'))); } String algKey = Strings.toUpperCase(algDetails); if (!keySizes.containsKey(algKey)) { return -1; } return ((Integer)keySizes.get(algKey)).intValue(); }
public static X9ECParameters getByName( String name) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); if (oid != null) { return getByOID(oid); } return null; }
static ASN1ObjectIdentifier getAlgorithmOID( String algorithmName) { algorithmName = Strings.toUpperCase(algorithmName); if (algorithms.containsKey(algorithmName)) { return (ASN1ObjectIdentifier)algorithms.get(algorithmName); } return new ASN1ObjectIdentifier(algorithmName); }
public void engineSetPadding(String padding) throws NoSuchPaddingException { String paddingName = Strings.toUpperCase(padding); // TDOD: make this meaningful... if (!paddingName.equals("NOPADDING")) { throw new NoSuchPaddingException("padding not available with IESCipher"); } }
public static X9ECParameters getByName( String name) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); if (oid != null) { return getByOID(oid); } return null; }
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"); } }
/** * Return the S-Box associated with SBoxName * @param sBoxName name of the S-Box * @return byte array representing the S-Box */ public static byte[] getSBox( String sBoxName) { byte[] sBox = (byte[])sBoxes.get(Strings.toUpperCase(sBoxName)); if (sBox == null) { throw new IllegalArgumentException("Unknown S-Box - possible types: " + "\"Default\", \"E-Test\", \"E-A\", \"E-B\", \"E-C\", \"E-D\", \"Param-Z\", \"D-Test\", \"D-A\"."); } return Arrays.clone(sBox); }
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"); } }
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); } }
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); } }