aboutsummaryrefslogtreecommitdiff
path: root/java_src/src/test/java/com/google/crypto/tink
AgeCommit message (Collapse)Author
2023-07-27Ensure that generated HPKE private keys are encoded to the correct length.wconner
Also, added utility methods for determining HPKE key lengths from KEM id. PiperOrigin-RevId: 551532702
2023-07-27Introduce end-to-end testing of LegacyFullMac, and fix problems uncovered by ↵lizatretyakova
the new tests. PiperOrigin-RevId: 551486832
2023-07-26Make use of the new utility function for proto conversions.lizatretyakova
PiperOrigin-RevId: 551218413
2023-07-26Ensure that legacy proto hybrid keys are parsed to crunchy keys.wconner
PiperOrigin-RevId: 551182852
2023-07-26Register JwtRsaSsaPkcs1 proto serialization.ioannanedelcu
PiperOrigin-RevId: 551117542
2023-07-25Add parsers and serializers for JwtRsaSsaPkcs1 parameters, public key and ↵ioannanedelcu
private key. PiperOrigin-RevId: 550921147
2023-07-24Add a create function to KmsEnvelopeAead.juerg
This function uses the new Parameters instead of the old proto KeyTemplates. PiperOrigin-RevId: 550614620
2023-07-24Remove redundant secret key access when serializing/parsing public keys.ioannanedelcu
PiperOrigin-RevId: 550503544
2023-07-21Add serialization for Ecies Public Keys.tholenst
PiperOrigin-RevId: 549938077
2023-07-21Replace some calls to "KeyTemplate.create" with "KeyTemplate.createFrom", ↵tholenst
taking a Parameters object. The call to "create" will be deprecated. Note: if a user calls e.g. AesGcmKeyManager.aes128GcmTemplate() without registering the proto serialization, before this CL, it was possible to get the serialized version. After this CL, this will break. I don't think this should be an issue since users basically always register everything anyhow. PiperOrigin-RevId: 549932301
2023-07-21When parsing Ecies parameters with Curve25519, only accept compressed points.tholenst
PiperOrigin-RevId: 549927290
2023-07-21Add JwtRsaSsaPkcs1PrivateKey class in Java.ioannanedelcu
PiperOrigin-RevId: 549884443
2023-07-21Replace some calls to "KeyTemplate.create" with "KeyTemplate.createFrom", ↵tholenst
taking a Parameters object. The call to "create" will be deprecated. Note: if a user calls e.g. AesGcmKeyManager.aes128GcmTemplate() without registering the proto serialization, before this CL, it was possible to get the serialized version. After this CL, this will break. I don't think this should be an issue since users basically always register everything anyhow. PiperOrigin-RevId: 549859554
2023-07-20Add a test with two envelope AEAD keys in a keyset.juerg
PiperOrigin-RevId: 549657384
2023-07-20Change EciesPublicKey constructor and point accessor into two cases: one for ↵tholenst
NIST curves and one for X25519 PiperOrigin-RevId: 549613138
2023-07-20Add JwtRsaSsaPkcs1PublicKey class in Java.ioannanedelcu
PiperOrigin-RevId: 549607483
2023-07-20In KeyTemplate, either store a proto or a parameters, and convert them on ↵tholenst
demand. This means registration of the respective serializer/parser can be done later. Users might save the object, and then later use it in e.g. Keysethandle.generateNew() and only have the serializer register at the later point. Hence we do it like this. Unfortunately, this means that we may have to throw a TinkBugException (or something else which is unchecked) since the APIs do not throw anything. Within Google nobody called these APIs outside of Tink, so I am relatively sure that this is no problem. Within Tink, the only remaining usage is in KeysetManager, and I changed things to throw a GeneralSecurityException there. PiperOrigin-RevId: 549594684
2023-07-20Remove remaining usages of Registry.getKeyManager and ↵juerg
Registry.getUntypedKeyManager in some tests. Instead, to verify that the key manager is registered, try to create a key. Also, remove the initialization test. It doesn't really add any additional value. PiperOrigin-RevId: 549582726
2023-07-19Add JwtRsaSsaPkcs1Parameters class in Java.ioannanedelcu
PiperOrigin-RevId: 549314771
2023-07-19Rename EcPointFormat accessors in EciesParameters and change behavior: if ↵tholenst
the curve is 25519 it must not be set. PiperOrigin-RevId: 549304481
2023-07-19Remove usages of Registry.getKeyManager and Registry.getUntypedKeyManager in ↵juerg
some tests. Instead, to verify that the key manager is registered, try to create a key. Also, remove the initialization test. It doesn't really add any additional value. PiperOrigin-RevId: 549278449
2023-07-19Add a way to create Macs from LegacyProtoKeys.lizatretyakova
PiperOrigin-RevId: 549266939
2023-07-18Move HmacProtoSerialization into internal/. This needs to be accessible from ↵lizatretyakova
a keymanager that is internal. PiperOrigin-RevId: 548968754
2023-07-14Avoid usages of "KeyTemplate.getOutputPrefix". We want to deprecate it in ↵tholenst
the future. PiperOrigin-RevId: 548076147
2023-07-12Remove usages of Registry.getKeyManager and Registry.getUntypedKeyManager in ↵juerg
some tests. Instead, to verify that the key manager is registered, try to create a key. Also, remove the initialization test. It doesn't really add any additional value. PiperOrigin-RevId: 547475050
2023-07-12Create EciesPublicKey class in Java.ioannanedelcu
PiperOrigin-RevId: 547449244
2023-07-12Delete KeyDerivationkeyTemplates.tholenst
This isn't needed anymore -- we now fully support Parameters. Also, this was never in a release, so I'm sure that it's never used. Note that even if a user uses it, they can just replace KeyTemplate keyDerivationTemplate = KeyDerivationKeyTemplates.createPrfBasedKeyTemplate(a, b); with PrfBasedKeyDerivationParameters.builder() .setPrfParameters((PrfParameters) a.toParameters()) .setDerivedKeyParameters(b.toParameters()) .build(); (Typically, one doesn't need to convert it into a KeyTemplate -- if one does, one can just call KeyTemplate.fromProto()). PiperOrigin-RevId: 547406999
2023-07-11Signature: Replace the validation tests with tests checking if the key ↵tholenst
generation succeeds. This is a bit more accurate, but has the disadvantage of being potentially slower. Anyhow, i want to change the template functions to not return these pairs (output_prefix, format) anymore, so we need to change this. PiperOrigin-RevId: 547128537
2023-07-10Prfs & StreamingAeads: Replace the validation tests with tests checking if ↵tholenst
the key generation succeeds. This is a bit more accurate, but has the disadvantage of being potentially slower. Anyhow, i want to change the template functions to not return these pairs (output_prefix, format) anymore, so we need to change this. PiperOrigin-RevId: 546854974
2023-07-10Aeads: Replace the validation tests with tests checking if the key ↵tholenst
generation succeeds. This is a bit more accurate, but has the disadvantage of being potentially slower. Anyhow, i want to change the template functions to not return these pairs (output_prefix, format) anymore, so we need to change this. PiperOrigin-RevId: 546832073
2023-07-10Add "KeysetHandle#equalsKeyset".tholenst
This allows to compare two keysets, which is useful when one wants to have a guarantee that the two keysets are equal (for example, if one gets one from a KMS and the other from disk, but wants no change). #tinkPublicApiChange PiperOrigin-RevId: 546812109
2023-07-10Macs: Replace the validation tests with tests checking if the key generation ↵tholenst
succeeds. This is a bit more accurate, but has the disadvantage of being potentially slower. Anyhow, i want to change the template functions to not return these pairs (output_prefix, format) anymore, so we need to change this. PiperOrigin-RevId: 546806101
2023-07-07Register the PrfBasedDeriver protoserialization.tholenst
Note: in the KeyDerivationKeyTemplatesTest we need to remove the "LEGACY" test case since when deserializaing this and serializing it again it may change to "CRUNCHY". PiperOrigin-RevId: 546274713
2023-07-07Add Parser and Serializer for EciesParameters.ioannanedelcu
PiperOrigin-RevId: 546265787
2023-07-06Remove usages of Registry.getKeyManager and Registry.getUntypedKeyManager in ↵juerg
some tests. Instead, to verify that the key manager is registered, try to create a key. Also, remove the initialization test. It doesn't really add any additional value. PiperOrigin-RevId: 546012816
2023-07-06Avoid KeyTemplate.getTypeUrl().tholenst
This method will be deprecated/removed. PiperOrigin-RevId: 545928847
2023-07-05Add a static factory method createFrom to "KeyTemplate.java".tholenst
PiperOrigin-RevId: 545702188
2023-07-05Check that X25519 only accepts compressed elliptic curve points.ioannanedelcu
PiperOrigin-RevId: 545634490
2023-07-05Remove the remaining usages outside the package of KeyTemplate.getValue().tholenst
PiperOrigin-RevId: 545631681
2023-07-05Add EciesParameters class in Java.ioannanedelcu
PiperOrigin-RevId: 545623249
2023-07-05If available, use Conscrypt generate randomness.juerg
Also, we want to provide an additional internal function "validateUsesConscrypt" that lets us enforce to only use Conscrypt to generate randomness. For this, we move the "Random" class to internal, and add this function. The subtle class forwards calls to the internal class. PiperOrigin-RevId: 545581282
2023-07-04Avoid KeyTemplate#getValue in the Jwt tests.tholenst
PiperOrigin-RevId: 545437494
2023-07-03Move the PrfBasedKeyDerivationKeyProtoSerialization to Internal.tholenst
This will be called from the keymanager which is internal. Hence it has to be internal. PiperOrigin-RevId: 545244314
2023-07-03Add serialization and parsing for PrfBasedKeyDerivationKey objects.tholenst
PiperOrigin-RevId: 545208958
2023-07-03Use testKeyTemplateCompatible where appropriate in the ↵tholenst
JwtRsaSsaPkcs1SignKeyManagerTest PiperOrigin-RevId: 545208784
2023-07-03Avoid KeyTemplate.java methods in some tests.tholenst
The only thing which one should call on KeyTemplate.java objects is "toParameters". PiperOrigin-RevId: 545200541
2023-06-29Add a parser and serializer for PrfBasedKeyDerivationParameters.tholenst
PiperOrigin-RevId: 544367537
2023-06-29Add support for full Mac primitive creation to AesCmacKeyManager. Remove ↵lizatretyakova
now-unnecessary setup in the corresponding test. PiperOrigin-RevId: 544356043
2023-06-28Don't parse RSA keys when using TSAN.juerg
PiperOrigin-RevId: 544084013
2023-06-28Introduce a way to create a PrfMac using the new HmacKey.lizatretyakova
PiperOrigin-RevId: 544080099