Home
last modified time | relevance | path

Searched refs:keyConfig (Results 1 – 21 of 21) sorted by relevance

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/jni/java/com/android/adservices/ohttp/
DObliviousHttpKeyConfigTest.java50 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in create_configuresKeyCorrectly() local
52 Assert.assertEquals(keyConfig.keyId(), 0X01); in create_configuresKeyCorrectly()
53 Assert.assertEquals(keyConfig.kemId(), 0X0020); in create_configuresKeyCorrectly()
54 String publicKeyHex = BaseEncoding.base16().lowerCase().encode(keyConfig.getPublicKey()); in create_configuresKeyCorrectly()
57 Assert.assertEquals(keyConfig.kdfId(), 0X0001); in create_configuresKeyCorrectly()
58 Assert.assertEquals(keyConfig.aeadId(), 0X0001); in create_configuresKeyCorrectly()
132 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in serializeOhttpPayloadHeader_returnsCorrectHeader() local
133 byte[] ohttpPayloadHeader = keyConfig.serializeOhttpPayloadHeader(); in serializeOhttpPayloadHeader_returnsCorrectHeader()
148 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in createRecipientKeyInfoBytes_returnsCorrectInfo() local
149 RecipientKeyInfo response = keyConfig.createRecipientKeyInfo(hasMediaTypeChanged); in createRecipientKeyInfoBytes_returnsCorrectInfo()
[all …]
DObliviousHttpClientTest.java55 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in create_unsupportedAlgorithms_throwsError() local
59 () -> ObliviousHttpClient.create(keyConfig)); in create_unsupportedAlgorithms_throwsError()
66 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_clientCreatedSuccessfully()
74 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_kemIdSetCorrectly()
77 testVector.keyConfig.kemId()); in create_supportedAlgorithms_kemIdSetCorrectly()
84 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_kdfIdSetCorrectly()
87 testVector.keyConfig.kdfId()); in create_supportedAlgorithms_kdfIdSetCorrectly()
94 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_aeadIdSetCorrectly()
97 testVector.keyConfig.aeadId()); in create_supportedAlgorithms_aeadIdSetCorrectly()
107 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in createObliviousHttpRequest_testAllTestVectors()
[all …]
DObliviousHttpGatewayTest.java56 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in decrypt_canDecryptPayloadsEncryptedByOhttpClient()
82 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in decrypt_canDecryptPayloadsEncryptedByOhttpClient_withServerAuctionMediaTypeChange()
107 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_canBeDecryptedByOhttpClient()
139 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_canBeDecryptedByOhttpClient_withServerAuctionMediaTypeChange()
168 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_missingInfo_throwsError()
191 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_missingInfo_throwsError_withServerAuctionMediaTypeChange()
DObliviousHttpRequestTest.java52 ObliviousHttpKeyConfig keyConfig = in serialize_serializesCorrectly() local
60 keyConfig, in serialize_serializesCorrectly()
/packages/modules/AdServices/adservices/service-core/jni/java/com/android/adservices/ohttp/
DObliviousHttpKeyConfig.java123 public static ObliviousHttpKeyConfig fromSerializedKeyConfig(byte[] keyConfig) in fromSerializedKeyConfig() argument
129 int keyId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKeyIdSizeInBytes); in fromSerializedKeyConfig()
132 int kemId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKemIdSizeInBytes); in fromSerializedKeyConfig()
137 Arrays.copyOfRange(keyConfig, currentIndex, currentIndex + publicKeyLength); in fromSerializedKeyConfig()
142 keyConfig, currentIndex, sSymmetricAlgorithmsLengthInBytes); in fromSerializedKeyConfig()
145 if (currentIndex + algorithmsLength != keyConfig.length) { in fromSerializedKeyConfig()
151 int kdfId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKdfIdSizeInBytes); in fromSerializedKeyConfig()
154 int aeadId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sAeadIdSizeInBytes); in fromSerializedKeyConfig()
299 byte[] keyConfig, int startingIndex, int numberOfBytes) throws InvalidKeySpecException { in writeUptoTwoBytesIntoInteger() argument
303 if (startingIndex + numberOfBytes > keyConfig.length) { in writeUptoTwoBytesIntoInteger()
[all …]
DObliviousHttpRequestContext.java32 public abstract ObliviousHttpKeyConfig keyConfig(); in keyConfig() method in ObliviousHttpRequestContext
45 ObliviousHttpKeyConfig keyConfig, in create() argument
49 return new AutoValue_ObliviousHttpRequestContext(keyConfig, enc, seed, hasMediaTypeChanged); in create()
DObliviousHttpClient.java52 private ObliviousHttpClient(ObliviousHttpKeyConfig keyConfig, HpkeAlgorithmSpec algorithmSpec) { in ObliviousHttpClient() argument
53 mObliviousHttpKeyConfig = keyConfig; in ObliviousHttpClient()
63 public static ObliviousHttpClient create(ObliviousHttpKeyConfig keyConfig) in create() argument
65 HpkeAlgorithmSpec hpkeAlgorithmSpec = HpkeAlgorithmSpec.fromKeyConfig(keyConfig); in create()
66 return new ObliviousHttpClient(keyConfig, hpkeAlgorithmSpec); in create()
DObliviousHttpRequest.java65 outputStream.write(requestContext().keyConfig().serializeOhttpPayloadHeader()); in serialize()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/jni/java/com/android/adservices/ohttp/algorithms/
DHpkeAlgorithmSpecTest.java37 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_createsHpkeAlgorithmSpec() local
39 HpkeAlgorithmSpec hpkeAlgorithmSpec = HpkeAlgorithmSpec.fromKeyConfig(keyConfig); in fromKeyConfig_createsHpkeAlgorithmSpec()
52 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_unsupportedKdf_throwsError() local
56 () -> HpkeAlgorithmSpec.fromKeyConfig(keyConfig)); in fromKeyConfig_unsupportedKdf_throwsError()
65 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_unsupportedAead_throwsError() local
69 () -> HpkeAlgorithmSpec.fromKeyConfig(keyConfig)); in fromKeyConfig_unsupportedAead_throwsError()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/encryption/
DJoinEncryptionKeyParserTest.java156 ObliviousHttpKeyConfig keyConfig = mJoinEncryptionKeyParser.getObliviousHttpKeyConfig(key); in getObliviousHttpKeyConfig_returnsKeyConfig() local
157 assertThat(keyConfig.keyId()).isEqualTo(0x01); in getObliviousHttpKeyConfig_returnsKeyConfig()
158 assertThat(BaseEncoding.base16().lowerCase().encode(keyConfig.getPublicKey())) in getObliviousHttpKeyConfig_returnsKeyConfig()
160 assertThat(keyConfig.kemId()).isEqualTo(0x0020); in getObliviousHttpKeyConfig_returnsKeyConfig()
161 assertThat(keyConfig.kdfId()).isEqualTo(0x0001); in getObliviousHttpKeyConfig_returnsKeyConfig()
162 assertThat(keyConfig.aeadId()).isEqualTo(0x0001); in getObliviousHttpKeyConfig_returnsKeyConfig()
DAuctionEncryptionKeyParserTest.java188 ObliviousHttpKeyConfig keyConfig = in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() local
190 assertThat(keyConfig.keyId()).isEqualTo(52); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
191 assertThat(keyConfig.getPublicKey()).isEqualTo(keyContent); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
192 assertThat(keyConfig.kemId()).isEqualTo(0x0005); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
193 assertThat(keyConfig.kdfId()).isEqualTo(0x0002); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
194 assertThat(keyConfig.aeadId()).isEqualTo(0x0022); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
DObliviousHttpRequestContextMarshallerTest.java153 assertThat(expectedOhttpContext.keyConfig()) in test_getContext_success()
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/com/android/adservices/ohttp/
DObliviousHttpTestFixtures.java163 public ObliviousHttpKeyConfig keyConfig; field in ObliviousHttpTestFixtures.OhttpTestVector
173 ObliviousHttpKeyConfig keyConfig) { in OhttpTestVector() argument
181 this.keyConfig = keyConfig; in OhttpTestVector()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/adselection/
DDBEncryptionContext.java93 byte[] keyConfig, in create() argument
101 .setKeyConfig(keyConfig) in create()
120 public abstract Builder setKeyConfig(byte[] keyConfig); in setKeyConfig() argument
DEncryptionContextDao.java72 .setKeyConfig(requestContext.keyConfig().serializeKeyConfigToBytes()) in persistEncryptionContext()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/encryption/
DObliviousHttpRequestContextMarshaller.java77 Objects.requireNonNull(requestContext.keyConfig()); in insertAuctionEncryptionContext()
78 Objects.requireNonNull(requestContext.keyConfig().serializeKeyConfigToBytes()); in insertAuctionEncryptionContext()
88 .setKeyConfig(requestContext.keyConfig().serializeKeyConfigToBytes()) in insertAuctionEncryptionContext()
DKAnonObliviousHttpEncryptorImpl.java80 ObliviousHttpClient.create(mObliviousRequestContext.keyConfig()); in decryptBytes()
DObliviousHttpEncryptorImpl.java96 ObliviousHttpClient client = ObliviousHttpClient.create(context.keyConfig()); in decryptBytes()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/adselection/
DDBEncryptionContextTest.java54 ObliviousHttpKeyConfig keyConfig = in testBuildEncryptionContext_success() local
62 .setKeyConfig(keyConfig.serializeKeyConfigToBytes()) in testBuildEncryptionContext_success()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/adselection/datahandlers/
DDBValidator.java32 Objects.requireNonNull(requestContext.keyConfig().serializeKeyConfigToBytes()); in validateEncryptionContext()
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/android/adservices/adselection/
DObliviousHttpEncryptorWithSeedImpl.java97 ObliviousHttpClient client = ObliviousHttpClient.create(context.keyConfig()); in decryptBytes()