@Test public void validateKey_empty() throws Exception { try { new AesSivKeyManager().validateKey(AesSivKey.getDefaultInstance()); fail(); } catch (GeneralSecurityException e) { } }
@Override public void validateKey(AesSivKey key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != 64) { throw new InvalidKeyException( "invalid key size: " + key.getKeyValue().size() + ". Valid keys must have 64 bytes."); } }
AesSivKeyManager extends KeyTypeManager<AesSivKey> { @Override public void validateKey(AesSivKey key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != 64) { throw new InvalidKeyException( "invalid key size: " + key.getKeyValue().size() + ". Valid keys must have 64 bytes."); } } }
AesSivKeyManager extends KeyTypeManager<AesSivKey> { @Override public void validateKey(AesSivKey key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != 64) { throw new InvalidKeyException( "invalid key size: " + key.getKeyValue().size() + ". Valid keys must have 64 bytes."); } } AesSivKeyManager(); }
AesSivKeyManager extends KeyTypeManager<AesSivKey> { @Override public void validateKey(AesSivKey key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != 64) { throw new InvalidKeyException( "invalid key size: " + key.getKeyValue().size() + ". Valid keys must have 64 bytes."); } } AesSivKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesSivKey key); @Override AesSivKey parseKey(ByteString byteString); @Override KeyFactory<AesSivKeyFormat, AesSivKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes256SivTemplate(); static final KeyTemplate rawAes256SivTemplate(); }
AesSivKeyManager extends KeyTypeManager<AesSivKey> { @Override public void validateKey(AesSivKey key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != 64) { throw new InvalidKeyException( "invalid key size: " + key.getKeyValue().size() + ". Valid keys must have 64 bytes."); } } AesSivKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesSivKey key); @Override AesSivKey parseKey(ByteString byteString); @Override KeyFactory<AesSivKeyFormat, AesSivKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes256SivTemplate(); static final KeyTemplate rawAes256SivTemplate();  }