io.quarkus.vault.transit.TransitContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-vault Show documentation
Show all versions of quarkus-vault Show documentation
Store your credentials securely in HashiCorp Vault
package io.quarkus.vault.transit;
import static io.quarkus.vault.runtime.StringHelper.stringToBytes;
import java.util.Arrays;
/**
* A transit context used for key derivation, when the key supports it.
*
* @see derived attribute in key creation
*/
public class TransitContext {
private byte[] context;
public static TransitContext fromContext(byte[] context) {
return new TransitContext(context);
}
public static TransitContext fromContext(String context) {
return new TransitContext(stringToBytes(context));
}
public TransitContext(byte[] context) {
this.context = context;
}
public byte[] getContext() {
return context;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
TransitContext that = (TransitContext) o;
return Arrays.equals(context, that.context);
}
@Override
public int hashCode() {
return Arrays.hashCode(context);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy