public static void initKeys(KeyStore keystore,Properties props){
  if (props.containsKey(Configuration.WEBCALL_KAFKA_AES)) {
    byte[] key=keystore.decodeKey(props.getProperty(Configuration.WEBCALL_KAFKA_AES));
    Preconditions.checkArgument((16 == key.length || 24 == key.length || 32 == key.length),Configuration.WEBCALL_KAFKA_AES + " MUST be 128, 192 or 256 bits long.");
    keystore.setKey(KeyStore.AES_KAFKA_WEBCALL,key);
    aesKey=key;
  }
  if (props.containsKey(Configuration.WEBCALL_KAFKA_MAC)) {
    byte[] key=keystore.decodeKey(props.getProperty(Configuration.WEBCALL_KAFKA_MAC));
    Preconditions.checkArgument((16 == key.length),Configuration.WEBCALL_KAFKA_MAC + " MUST be 128 bits long.");
    keystore.setKey(KeyStore.SIPHASH_KAFKA_WEBCALL,key);
    siphashKey=key;
  }
}

public static void initKeys ( KeyStore keystore , Properties props ) { if ( props . containsKey ( Configuration . WEBCALL_KAFKA_AES ) ) { byte [ ] key = keystore . decodeKey ( props . getProperty ( Configuration . WEBCALL_KAFKA_AES ) ) ; Preconditions . checkArgument ( ( 16 == key . length || 24 == key . length || 32 == key . length ) , Configuration . WEBCALL_KAFKA_AES + " MUST be 128, 192 or 256 bits long." ) ; keystore . setKey ( KeyStore . AES_KAFKA_WEBCALL , key ) ; aesKey = key ; } if ( props . containsKey ( Configuration . WEBCALL_KAFKA_MAC ) ) { byte [ ] key = keystore . decodeKey ( props . getProperty ( Configuration . WEBCALL_KAFKA_MAC ) ) ; Preconditions . checkArgument ( ( 16 == key . length ) , Configuration . WEBCALL_KAFKA_MAC + " MUST be 128 bits long." ) ; keystore . setKey ( KeyStore . SIPHASH_KAFKA_WEBCALL , key ) ; siphashKey = key ; } }
extract the required keys if they exist
