Search in sources :

Example 1 with InternalKeyHandle

use of com.google.crypto.tink.tinkkey.internal.InternalKeyHandle in project tink by google.

the class KeysetHandle method getKeys.

/**
 * Returns the keyset data as a list of {@link KeyHandle}s.
 */
public List<KeyHandle> getKeys() {
    ArrayList<KeyHandle> result = new ArrayList<>();
    for (Keyset.Key key : keyset.getKeyList()) {
        KeyData keyData = key.getKeyData();
        result.add(new InternalKeyHandle(new ProtoKey(keyData, KeyTemplate.fromProto(key.getOutputPrefixType())), key.getStatus(), key.getKeyId()));
    }
    return Collections.unmodifiableList(result);
}
Also used : EncryptedKeyset(com.google.crypto.tink.proto.EncryptedKeyset) Keyset(com.google.crypto.tink.proto.Keyset) InternalKeyHandle(com.google.crypto.tink.tinkkey.internal.InternalKeyHandle) ProtoKey(com.google.crypto.tink.tinkkey.internal.ProtoKey) ArrayList(java.util.ArrayList) KeyHandle(com.google.crypto.tink.tinkkey.KeyHandle) InternalKeyHandle(com.google.crypto.tink.tinkkey.internal.InternalKeyHandle) KeyData(com.google.crypto.tink.proto.KeyData)

Aggregations

EncryptedKeyset (com.google.crypto.tink.proto.EncryptedKeyset)1 KeyData (com.google.crypto.tink.proto.KeyData)1 Keyset (com.google.crypto.tink.proto.Keyset)1 KeyHandle (com.google.crypto.tink.tinkkey.KeyHandle)1 InternalKeyHandle (com.google.crypto.tink.tinkkey.internal.InternalKeyHandle)1 ProtoKey (com.google.crypto.tink.tinkkey.internal.ProtoKey)1 ArrayList (java.util.ArrayList)1