public static CipherAlgorithm fromEcmaId(int ecmaId) { for (CipherAlgorithm ca : CipherAlgorithm.values()) { if (ca.ecmaId == ecmaId) return ca; } throw new EncryptedDocumentException("cipher algorithm " + ecmaId + " not found"); }
CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), kb); setCipherAlgorithm(ca);
protected StandardEncryptionHeader(LittleEndianInput is) throws IOException { setFlags(is.readInt()); setSizeExtra(is.readInt()); setCipherAlgorithm(CipherAlgorithm.fromEcmaId(is.readInt())); setHashAlgorithm(HashAlgorithm.fromEcmaId(is.readInt())); int keySize = is.readInt();
CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits); setCipherAlgorithm(ca); setCipherProvider(ca.provider);
protected StandardEncryptionHeader(LittleEndianInput is) throws IOException { setFlags(is.readInt()); setSizeExtra(is.readInt()); setCipherAlgorithm(CipherAlgorithm.fromEcmaId(is.readInt())); setHashAlgorithm(HashAlgorithm.fromEcmaId(is.readInt())); int keySize = is.readInt();
public static CipherAlgorithm fromXmlId(String xmlId, int keySize) { for (CipherAlgorithm ca : CipherAlgorithm.values()) { if (!ca.xmlId.equals(xmlId)) continue; for (int ks : ca.allowedKeySize) { if (ks == keySize) return ca; } } throw new EncryptedDocumentException("cipher algorithm " + xmlId + "/" + keySize + " not found"); } }
CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), kb); setCipherAlgorithm(ca);
public static CipherAlgorithm fromXmlId(String xmlId, int keySize) { for (CipherAlgorithm ca : CipherAlgorithm.values()) { if (!ca.xmlId.equals(xmlId)) continue; for (int ks : ca.allowedKeySize) { if (ks == keySize) return ca; } } throw new EncryptedDocumentException("cipher algorithm " + xmlId + "/" + keySize + " not found"); } }
CipherAlgorithm ca = CipherAlgorithm.fromXmlId(keyData.getCipherAlgorithm().toString(), keyBits); setCipherAlgorithm(ca); setCipherProvider(ca.provider);
public static CipherAlgorithm fromEcmaId(int ecmaId) { for (CipherAlgorithm ca : CipherAlgorithm.values()) { if (ca.ecmaId == ecmaId) return ca; } throw new EncryptedDocumentException("cipher algorithm " + ecmaId + " not found"); }