mirror of
https://github.com/google/nomulus
synced 2026-04-10 11:39:29 +00:00
Expose encrypted data from the keyring
This makes it possible to request the encrypted data directly in application code. It will be used to download service account credential during "nomulus login". ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=222847905
This commit is contained in:
@@ -20,6 +20,8 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Qualifier;
|
||||
import org.bouncycastle.openpgp.PGPKeyPair;
|
||||
import org.bouncycastle.openpgp.PGPPrivateKey;
|
||||
@@ -126,4 +128,10 @@ public final class KeyModule {
|
||||
static String provideJsonCredential(Keyring keyring) {
|
||||
return keyring.getJsonCredential();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("encryptedDataRetriever")
|
||||
static Function<String, String> provideEncryptedDataRetriever(Keyring keyring) {
|
||||
return keyring::getEncryptedData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user