how to retrieve value from KVM using partialKey

We are storing public cert in KVM using Key as issuer_thumbprint

For example stored kvm keys

cn=issuer,ou=abc,l=usa,o=xyz_GlOj8oY4SkmMQoSotbKc0Pd8abc

cn=issuer,ou=abc,l=usa,o=xyz_xxxxxyyyyyy

Now we want to retrieve values based on issuer (ex:-issuer,ou=abc,l=usa,o=xyz)

Could you please let us know how can we achieve that?

Solved Solved
0 2 145
1 ACCEPTED SOLUTION

You can't do that.

The KVM is not a general-purpose database that supports full text search.

The KVM is a Key/value store.

given a key, you can get a value.

You can't do a search on a partial key.

One way you could _approximate_ what you want is to denormalize the data. Rather than storing it once with the key and value, store data multiple times, with the partial keys.

What I mean is

if the full key is A-B-C

and the value you stored against A-B-C is "xyz",

And you would also like to retrieve by "A-B". . . .

then you could also store in the KVM

"A-B" => "A-B-C"

In other words, a partial key, that points to a full key.

Then to perform a lookup on partial key, you'd have to do it in 2 steps:

1. lookup the partial key. Through that lookup, obtain the full key.

2. lookup on the full key.

View solution in original post

2 REPLIES 2

You can't do that.

The KVM is not a general-purpose database that supports full text search.

The KVM is a Key/value store.

given a key, you can get a value.

You can't do a search on a partial key.

One way you could _approximate_ what you want is to denormalize the data. Rather than storing it once with the key and value, store data multiple times, with the partial keys.

What I mean is

if the full key is A-B-C

and the value you stored against A-B-C is "xyz",

And you would also like to retrieve by "A-B". . . .

then you could also store in the KVM

"A-B" => "A-B-C"

In other words, a partial key, that points to a full key.

Then to perform a lookup on partial key, you'd have to do it in 2 steps:

1. lookup the partial key. Through that lookup, obtain the full key.

2. lookup on the full key.

Not applicable

if you have partial key, then you need to make it a complete key of KVM. So, you can use scripting policies or assign message policy to make a complete key inside the proxy flow before the KVM extraction policy.