test_class.declarator: context = new ContextWrapper(RuntimeEnvironment.application)
test_class.modifier: private final
test_class.original_string: private final ContextWrapper context = new ContextWrapper(RuntimeEnvironment.application);
test_class.type: ContextWrapper
test_class.var_name: context
test_class.declarator: shadowContext = Shadow.extract(context)
test_class.modifier: private final
test_class.original_string: private final ShadowContextWrapper shadowContext = Shadow.extract(context);
test_class.type: ShadowContextWrapper
test_class.var_name: shadowContext
test_class.declarator: fingerprintManager = mock(FingerprintManager.class)
test_class.modifier: private final
test_class.original_string: private final FingerprintManager fingerprintManager = mock(FingerprintManager.class);
test_class.type: FingerprintManager
test_class.var_name: fingerprintManager
test_class.declarator: storage = spy(new TestStorage())
test_class.modifier: private final
test_class.original_string: private final Storage storage = spy(new TestStorage());
test_class.type: Storage
test_class.var_name: storage
test_class.declarator: keyStore = mock(KeyStore.class)
test_class.modifier: private final
test_class.original_string: private final KeyStore keyStore = mock(KeyStore.class);
test_class.type: KeyStore
test_class.var_name: keyStore
test_class.declarator: keyGenerator = mock(KeyPairGenerator.class)
test_class.modifier: private final
test_class.original_string: private final KeyPairGenerator keyGenerator = mock(KeyPairGenerator.class);
test_class.type: KeyPairGenerator
test_class.var_name: keyGenerator
test_class.declarator: keyFactory = mock(KeyFactory.class)
test_class.modifier: private final
test_class.original_string: private final KeyFactory keyFactory = mock(KeyFactory.class);
test_class.type: KeyFactory
test_class.var_name: keyFactory
test_class.declarator: whorlwind = new RealWhorlwind(context, fingerprintManager, storage, //
        "test", keyStore, keyGenerator, keyFactory)
test_class.modifier: private final
test_class.original_string: private final RealWhorlwind whorlwind = new RealWhorlwind(context, fingerprintManager, storage, //
        "test", keyStore, keyGenerator, keyFactory);
test_class.type: RealWhorlwind
test_class.var_name: whorlwind
test_class.file: whorlwind/src/test/java/com/squareup/whorlwind/RealWhorlwindTest.java
test_class.identifier: RealWhorlwindTest
test_case.body: @Test public void writeThrowsOnSubscribeWhenCannotStoreSecurely() {
      shadowContext.denyPermissions(USE_FINGERPRINT);
  
      Throwable expected = whorlwind.write("test", ByteString.encodeUtf8("test")).blockingGet();
      assertThat(expected).hasMessage(
          "Can't store securely. Check canStoreSecurely() before attempting to read/write.");
  
      verifyZeroInteractions(storage);
    }
test_case.class_method_signature: RealWhorlwindTest.writeThrowsOnSubscribeWhenCannotStoreSecurely()
test_case.full_signature: @Test public void writeThrowsOnSubscribeWhenCannotStoreSecurely()
test_case.identifier: writeThrowsOnSubscribeWhenCannotStoreSecurely
test_case.invocations: denyPermissions blockingGet write encodeUtf8 hasMessage assertThat verifyZeroInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void writeThrowsOnSubscribeWhenCannotStoreSecurely()
focal_class.declarator: context
focal_class.modifier: private final
focal_class.original_string: private final Context context;
focal_class.type: Context
focal_class.var_name: context
focal_class.declarator: fingerprintManager
focal_class.modifier: private final
focal_class.original_string: private final FingerprintManager fingerprintManager;
focal_class.type: FingerprintManager
focal_class.var_name: fingerprintManager
focal_class.declarator: storage
focal_class.modifier: @SuppressWarnings("WeakerAccess") // Used in nested class. Removing synthetic accessor.
    final
focal_class.original_string: @SuppressWarnings("WeakerAccess") // Used in nested class. Removing synthetic accessor.
    final Storage storage;
focal_class.type: Storage
focal_class.var_name: storage
focal_class.declarator: keyAlias
focal_class.modifier: private final
focal_class.original_string: private final String keyAlias;
focal_class.type: String
focal_class.var_name: keyAlias
focal_class.declarator: keyStore
focal_class.modifier: private final
focal_class.original_string: private final KeyStore keyStore;
focal_class.type: KeyStore
focal_class.var_name: keyStore
focal_class.declarator: keyGenerator
focal_class.modifier: private final
focal_class.original_string: private final KeyPairGenerator keyGenerator;
focal_class.type: KeyPairGenerator
focal_class.var_name: keyGenerator
focal_class.declarator: keyFactory
focal_class.modifier: private final
focal_class.original_string: private final KeyFactory keyFactory;
focal_class.type: KeyFactory
focal_class.var_name: keyFactory
focal_class.declarator: readerScanning
focal_class.modifier: private final
focal_class.original_string: private final AtomicBoolean readerScanning;
focal_class.type: AtomicBoolean
focal_class.var_name: readerScanning
focal_class.declarator: dataLock = new Object()
focal_class.modifier: @SuppressWarnings("WeakerAccess") // Used in nested class. Removing synthetic accessor.
    final
focal_class.original_string: @SuppressWarnings("WeakerAccess") // Used in nested class. Removing synthetic accessor.
    final Object dataLock = new Object();
focal_class.type: Object
focal_class.var_name: dataLock
focal_class.file: whorlwind/src/main/java/com/squareup/whorlwind/RealWhorlwind.java
focal_class.identifier: RealWhorlwind
focal_class.class_method_signature: RealWhorlwind.RealWhorlwind(Context context, FingerprintManager fingerprintManager, Storage storage,
        String keyAlias, KeyStore keyStore, KeyPairGenerator keyGenerator, KeyFactory keyFactory)
focal_class.full_signature:   RealWhorlwind(Context context, FingerprintManager fingerprintManager, Storage storage,
        String keyAlias, KeyStore keyStore, KeyPairGenerator keyGenerator, KeyFactory keyFactory)
focal_class.identifier: RealWhorlwind
focal_class.parameters: (Context context, FingerprintManager fingerprintManager, Storage storage,
        String keyAlias, KeyStore keyStore, KeyPairGenerator keyGenerator, KeyFactory keyFactory)
focal_class.signature:  RealWhorlwind(Context context, FingerprintManager fingerprintManager, Storage storage,
        String keyAlias, KeyStore keyStore, KeyPairGenerator keyGenerator, KeyFactory keyFactory)
focal_class.class_method_signature: RealWhorlwind.canStoreSecurely()
focal_class.full_signature: @Override public boolean canStoreSecurely()
focal_class.identifier: canStoreSecurely
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean canStoreSecurely()
focal_class.class_method_signature: RealWhorlwind.hasPermission()
focal_class.full_signature: private boolean hasPermission()
focal_class.identifier: hasPermission
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasPermission()
focal_class.class_method_signature: RealWhorlwind.checkSelfPermission(String permission)
focal_class.full_signature: private int checkSelfPermission(String permission)
focal_class.identifier: checkSelfPermission
focal_class.modifiers: private
focal_class.parameters: (String permission)
focal_class.return: int
focal_class.signature: int checkSelfPermission(String permission)
focal_class.class_method_signature: RealWhorlwind.checkCanStoreSecurely()
focal_class.full_signature:  void checkCanStoreSecurely()
focal_class.identifier: checkCanStoreSecurely
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkCanStoreSecurely()
focal_class.class_method_signature: RealWhorlwind.write(@NonNull final String name, @Nullable final ByteString value)
focal_class.full_signature: @Override public Completable write(@NonNull final String name, @Nullable final ByteString value)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (@NonNull final String name, @Nullable final ByteString value)
focal_class.return: Completable
focal_class.signature: Completable write(@NonNull final String name, @Nullable final ByteString value)
focal_class.class_method_signature: RealWhorlwind.read(@NonNull String name)
focal_class.full_signature: @Override public Observable<ReadResult> read(@NonNull String name)
focal_class.identifier: read
focal_class.modifiers: @Override public
focal_class.parameters: (@NonNull String name)
focal_class.return: Observable<ReadResult>
focal_class.signature: Observable<ReadResult> read(@NonNull String name)
focal_class.class_method_signature: RealWhorlwind.prepareKeyStore()
focal_class.full_signature:  void prepareKeyStore()
focal_class.identifier: prepareKeyStore
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void prepareKeyStore()
focal_class.class_method_signature: RealWhorlwind.createCipher()
focal_class.full_signature: static Cipher createCipher()
focal_class.identifier: createCipher
focal_class.modifiers: static
focal_class.parameters: ()
focal_class.return: Cipher
focal_class.signature: Cipher createCipher()
focal_class.class_method_signature: RealWhorlwind.getPublicKey()
focal_class.full_signature: @SuppressWarnings("WeakerAccess") PublicKey getPublicKey()
focal_class.identifier: getPublicKey
focal_class.modifiers: @SuppressWarnings("WeakerAccess")
focal_class.parameters: ()
focal_class.return: PublicKey
focal_class.signature: PublicKey getPublicKey()
focal_class.class_method_signature: RealWhorlwind.getPrivateKey()
focal_class.full_signature:  PrivateKey getPrivateKey()
focal_class.identifier: getPrivateKey
focal_class.parameters: ()
focal_class.return: PrivateKey
focal_class.signature: PrivateKey getPrivateKey()
focal_class.class_method_signature: RealWhorlwind.removeKey()
focal_class.full_signature:  void removeKey()
focal_class.identifier: removeKey
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void removeKey()
focal_class.superclass: extends Whorlwind
focal_method.body: @Override public Completable write(@NonNull final String name, @Nullable final ByteString value) {
      return Completable.fromAction(new Action() {
        @Override public void run() throws Exception {
          checkCanStoreSecurely();
  
          synchronized (dataLock) {
            if (value == null) {
              storage.remove(name);
              return;
            }
  
            prepareKeyStore();
  
            Cipher cipher = createCipher();
            cipher.init(Cipher.ENCRYPT_MODE, getPublicKey());
  
            storage.put(name, ByteString.of(cipher.doFinal(value.toByteArray())));
          }
        }
      });
    }
focal_method.class_method_signature: RealWhorlwind.write(@NonNull final String name, @Nullable final ByteString value)
focal_method.full_signature: @Override public Completable write(@NonNull final String name, @Nullable final ByteString value)
focal_method.identifier: write
focal_method.invocations: fromAction checkCanStoreSecurely remove prepareKeyStore createCipher init getPublicKey put of doFinal toByteArray
focal_method.modifiers: @Override public
focal_method.parameters: (@NonNull final String name, @Nullable final ByteString value)
focal_method.return: Completable
focal_method.signature: Completable write(@NonNull final String name, @Nullable final ByteString value)