Home
last modified time | relevance | path

Searched refs:publicKey (Results 1 – 25 of 66) sorted by relevance

123

/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/topics/
DHpkeEncrypter.java50 @NonNull byte[] publicKey, @NonNull byte[] plainText, @NonNull byte[] contextInfo) { in encrypt()
51 Objects.requireNonNull(publicKey); in encrypt()
55 if (!isValidKey(publicKey)) { in encrypt()
59 return HpkeJni.encrypt(publicKey, plainText, contextInfo); in encrypt()
63 private boolean isValidKey(byte[] publicKey) { in isValidKey() argument
65 if (publicKey.length != X25519_PUBLIC_VALUE_LEN) { in isValidKey()
71 Arrays.toString(publicKey), X25519_PUBLIC_VALUE_LEN, publicKey.length); in isValidKey()
DEncryptionManager.java150 private Optional<EncryptedTopic> encryptTopicWithKey(Topic topic, Optional<String> publicKey) { in encryptTopicWithKey() argument
154 if (publicKey.isPresent() && optionalTopicJSON.isPresent()) { in encryptTopicWithKey()
159 byte[] base64DecodedPublicKey = Base64.getDecoder().decode(publicKey.get()); in encryptTopicWithKey()
166 return buildEncryptedTopic(response, publicKey.get()); in encryptTopicWithKey()
175 publicKey); in encryptTopicWithKey()
188 private static Optional<EncryptedTopic> buildEncryptedTopic(byte[] response, String publicKey) { in buildEncryptedTopic() argument
193 sLogger.e("Null encryption response received for public key = %s", publicKey); in buildEncryptedTopic()
223 return Optional.of(EncryptedTopic.create(cipherText, publicKey, encapsulatedKey)); in buildEncryptedTopic()
/packages/modules/AdServices/adservices/service-core/jni/java/com/android/adservices/ohttp/
DObliviousHttpKeyConfig.java71 abstract byte[] publicKey(); in publicKey() method in ObliviousHttpKeyConfig
136 byte[] publicKey = in fromSerializedKeyConfig()
161 .setPublicKey(publicKey) in fromSerializedKeyConfig()
213 return Arrays.copyOf(publicKey(), publicKey().length); in getPublicKey()
253 System.arraycopy(publicKey(), 0, serializedArray, currentIndex, publicKey().length); in serializeKeyConfigToBytes()
254 currentIndex += publicKey().length; in serializeKeyConfigToBytes()
292 public abstract Builder setPublicKey(byte[] publicKey); in setPublicKey() argument
340 + publicKey().length in getSerializedByteArraySize()
DOhttpJniWrapper.java103 byte[] publicKey, in hpkeCtxSetupSenderWithSeed() argument
110 Objects.requireNonNull(publicKey); in hpkeCtxSetupSenderWithSeed()
118 publicKey, in hpkeCtxSetupSenderWithSeed()
154 byte[] publicKey, in hpkeEncrypt() argument
165 publicKey, in hpkeEncrypt()
314 byte[] publicKey, in hpkeCtxSetupSenderWithSeed() argument
DIOhttpJniWrapper.java63 byte[] publicKey, in hpkeCtxSetupSenderWithSeed() argument
92 byte[] publicKey, in hpkeEncrypt() argument
/packages/modules/RemoteKeyProvisioning/app/src/com/android/rkpdapp/database/
DProvisionedKey.java49 public byte[] publicKey; field in ProvisionedKey
70 @NonNull byte[] publicKey, @NonNull byte[] certificateChain, in ProvisionedKey() argument
74 this.publicKey = publicKey; in ProvisionedKey()
86 && Arrays.equals(publicKey, that.publicKey) in equals()
97 result = 31 * result + Arrays.hashCode(publicKey); in hashCode()
111 + ", publicKey=" + Arrays.toString(publicKey) in toString()
DRkpKey.java34 byte[] publicKey) { in RkpKey() argument
39 this.mPublicKey = publicKey; in RkpKey()
/packages/modules/OnDevicePersonalization/federatedcompute/jni/cpp/
Dhpke_jni.cc30 jbyteArray publicKey, jbyteArray plainText, jbyteArray associatedData) { in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt() argument
32 if (publicKey == NULL || plainText == NULL || associatedData == NULL) { in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
36 if (env->GetArrayLength(publicKey) != X25519_PUBLIC_VALUE_LEN) { in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
45 jbyte* peer_public_key = env->GetByteArrayElements(publicKey, 0); in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
57 /* peer_public_key_len= */ env->GetArrayLength(publicKey), in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
60 env->ReleaseByteArrayElements(publicKey, peer_public_key, JNI_ABORT); in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
65 env->ReleaseByteArrayElements(publicKey, peer_public_key, JNI_ABORT); in Java_com_android_federatedcompute_services_encryption_jni_HpkeJni_encrypt()
/packages/modules/AdServices/adservices/service-core/jni/cpp/
Dhpke_jni.cpp30 jbyteArray publicKey, jbyteArray plainText, jbyteArray associatedData) { in Java_com_android_adservices_HpkeJni_encrypt() argument
32 if (publicKey == NULL || plainText == NULL || associatedData == NULL) { in Java_com_android_adservices_HpkeJni_encrypt()
36 if (env->GetArrayLength(publicKey) != X25519_PUBLIC_VALUE_LEN) { in Java_com_android_adservices_HpkeJni_encrypt()
45 jbyte* peer_public_key = env->GetByteArrayElements(publicKey, 0); in Java_com_android_adservices_HpkeJni_encrypt()
57 /* peer_public_key_len= */ env->GetArrayLength(publicKey), in Java_com_android_adservices_HpkeJni_encrypt()
60 env->ReleaseByteArrayElements(publicKey, peer_public_key, JNI_ABORT); in Java_com_android_adservices_HpkeJni_encrypt()
65 env->ReleaseByteArrayElements(publicKey, peer_public_key, JNI_ABORT); in Java_com_android_adservices_HpkeJni_encrypt()
/packages/modules/Connectivity/nearby/framework/java/android/nearby/
DPublicCredential.java63 byte[] publicKey, in PublicCredential() argument
67 mPublicKey = publicKey; in PublicCredential()
155 @NonNull byte[] publicKey, in Builder() argument
164 publicKey != null && publicKey.length > 0, "publicKey cannot be empty"); in Builder()
174 mPublicKey = publicKey; in Builder()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/
DIkeKePayload.java246 DHPublicKey publicKey = (DHPublicKey) keyPair.getPublic(); in createOutboundModpKePayload() local
250 BigIntegerUtils.bigIntegerToUnsignedByteArray(publicKey.getY(), keySize); in createOutboundModpKePayload()
269 PublicKey publicKey = keyPair.getPublic(); in createOutboundCurveKePayload() local
270 byte[] x509EncodedPubKeyBytes = publicKey.getEncoded(); in createOutboundCurveKePayload()
356 DHPublicKey publicKey = (DHPublicKey) dhKeyFactory.generatePublic(publicKeySpec); in getModpSharedKey() local
358 dhKeyAgreement.doPhase(publicKey, true /* Last phase */); in getModpSharedKey()
398 PublicKey publicKey = in getCurveSharedKey() local
400 keyAgreement.doPhase(publicKey, true /* Last phase */); in getCurveSharedKey()
/packages/modules/RemoteKeyProvisioning/app/tests/unit/src/com/android/rkpdapp/unittest/
DUtils.java113 public static byte[] getBytesFromP256PublicKey(ECPublicKey publicKey) throws Exception { in getBytesFromP256PublicKey() argument
115 (publicKey.getParams().getOrder().bitLength() + Byte.SIZE - 1) / Byte.SIZE; in getBytesFromP256PublicKey()
120 final byte[] x = publicKey.getW().getAffineX().toByteArray(); in getBytesFromP256PublicKey()
131 final byte[] y = publicKey.getW().getAffineY().toByteArray(); in getBytesFromP256PublicKey()
246 public static byte[] encodeEd25519PubKey(byte[] publicKey) throws Exception { in encodeEd25519PubKey() argument
253 .put(X_COORDINATE, publicKey) in encodeEd25519PubKey()
283 public static byte[] encodeX25519PubKey(byte[] publicKey) throws Exception { in encodeX25519PubKey() argument
286 byte[] kid = digest.digest(publicKey); in encodeX25519PubKey()
293 .put(X_COORDINATE, publicKey) in encodeX25519PubKey()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/aggregation/
DAggregateEncryptionKey.java38 @NonNull String publicKey, in AggregateEncryptionKey() argument
43 mPublicKey = publicKey; in AggregateEncryptionKey()
129 public @NonNull Builder setPublicKey(@NonNull String publicKey) { in setPublicKey() argument
130 mPublicKey = publicKey; in setPublicKey()
DAggregateCryptoConverter.java86 final byte[] publicKey = sBase64Decoder.decode(publicKeyBase64Encoded); in encrypt()
97 encryptWithHpke(publicKey, payloadCborEncoded, contextInfo); in encrypt()
199 static byte[] encryptWithHpke(byte[] publicKey, byte[] plainText, byte[] contextInfo) { in encryptWithHpke() argument
200 return HpkeJni.encrypt(publicKey, plainText, contextInfo); in encryptWithHpke()
/packages/modules/AdServices/adservices/libraries/cobalt/java/com/android/cobalt/crypto/
DHpkeEncrypter.java153 byte[] publicKey, in encrypt() argument
160 if (publicKey.length != X25519_PUBLIC_VALUE_LEN || contextInfoBytes.length == 0) { in encrypt()
165 X25519_PUBLIC_VALUE_LEN, publicKey.length, contextInfoBytes.length)); in encrypt()
174 mEncrypter.encrypt(publicKey, message.toByteArray(), contextInfoBytes); in encrypt()
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/android/adservices/adselection/
DAuctionEncryptionKeyFixture.java95 .setPublicKey(AUCTION_KEY_2.publicKey())
134 .put(PUBLIC_KEY_LABEL, key.publicKey()); in getAuctionKeyJson()
167 public abstract String publicKey(); in publicKey() method in AuctionEncryptionKeyFixture.AuctionKey
177 public abstract Builder setPublicKey(String publicKey); in setPublicKey() argument
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/adselection/
DDBEncryptionKey.java99 String publicKey, in create() argument
107 .setPublicKey(publicKey) in create()
125 public abstract Builder setPublicKey(String publicKey); in setPublicKey() argument
DDBProtectedServersEncryptionConfig.java129 String publicKey, in create() argument
139 .setPublicKey(publicKey) in create()
170 public abstract Builder setPublicKey(String publicKey); in setPublicKey() argument
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/data/
DFederatedComputeEncryptionKey.java101 @NonNull String publicKey, in FederatedComputeEncryptionKey() argument
108 this.mPublicKey = publicKey; in FederatedComputeEncryptionKey()
226 @NonNull String publicKey, in Builder() argument
233 mPublicKey = publicKey; in Builder()
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/encryption/
DHpkeJniEncrypter.java28 public byte[] encrypt(byte[] publicKey, byte[] plainText, byte[] associatedData) { in encrypt() argument
29 return HpkeJni.encrypt(publicKey, plainText, associatedData); in encrypt()
/packages/modules/AdServices/adservices/libraries/cobalt/java/com/android/cobalt/testing/crypto/
DHpkeEncryptFactory.java29 public byte[] encrypt(byte[] publicKey, byte[] plainText, byte[] contextInfo) { in noOpHpkeEncrypt()
41 public byte[] encrypt(byte[] publicKey, byte[] plainText, byte[] contextInfo) {
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/cobalt/
DHpkeEncryptImpl.java40 @NonNull byte[] publicKey, @NonNull byte[] plainText, @NonNull byte[] contextInfo) { in encrypt()
41 return HpkeJni.encrypt(publicKey, plainText, contextInfo); in encrypt()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/signature/
DProtectedAudienceSignatureManager.java121 for (byte[] publicKey : publicKeys) { in isVerified()
123 publicKey, serialized, signedContextualAds.getSignature())) { in isVerified()
126 Base64.getEncoder().encodeToString(publicKey)); in isVerified()
134 Base64.getEncoder().encodeToString(publicKey)); in isVerified()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/encryption/
DAdSelectionEncryptionKey.java54 public abstract byte[] publicKey(); in publicKey() method in AdSelectionEncryptionKey
71 public abstract Builder setPublicKey(byte[] publicKey); in setPublicKey() argument
/packages/apps/Settings/src/com/android/settings/wifi/dpp/
DAdbQrCode.java117 String publicKey = getValueOrNull(keyValueList, PREFIX_DPP_PUBLIC_KEY); in parseWifiDppQrCode() local
118 if (TextUtils.isEmpty(publicKey)) { in parseWifiDppQrCode()
121 mPublicKey = publicKey; in parseWifiDppQrCode()

123