Search in sources :

Example 1 with ContentCryptographer

use of keywhiz.service.crypto.ContentCryptographer in project keywhiz by square.

the class SecretControllerMockTest method createController.

private SecretController createController(Long maximumSecretSizeInBytesInclusive) {
    KeywhizConfig config = new KeywhizConfig();
    config.setMaximumSecretSizeInBytesInclusive(maximumSecretSizeInBytesInclusive);
    ContentCryptographer cryptographer = mock(ContentCryptographer.class);
    when(cryptographer.computeHmac(any(), any())).thenReturn("hmac");
    when(cryptographer.encryptionKeyDerivedFrom(any())).thenReturn(mock(ContentCryptographer.Encrypter.class));
    return new SecretController(mock(SecretTransformer.class), cryptographer, mock(SecretDAO.class), mock(AclDAO.class), config);
}
Also used : ContentCryptographer(keywhiz.service.crypto.ContentCryptographer) SecretTransformer(keywhiz.service.crypto.SecretTransformer) KeywhizConfig(keywhiz.KeywhizConfig)

Aggregations

KeywhizConfig (keywhiz.KeywhizConfig)1 ContentCryptographer (keywhiz.service.crypto.ContentCryptographer)1 SecretTransformer (keywhiz.service.crypto.SecretTransformer)1