net.java.truecommons.key.spec.SecretKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truecommons-key-spec Show documentation
Show all versions of truecommons-key-spec Show documentation
Specifies a pluggable API for key management.
The newest version!
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truecommons.key.spec;
import net.java.truecommons.shed.ImplementationsShouldExtend;
import javax.annotation.Nullable;
import java.nio.ByteBuffer;
/**
* A key with properties for secret key management.
*
* Implementations do not need to be safe for multi-threading.
*
* @param the type of this secret key.
* @since TrueCommons 2.2
* @author Christian Schlichtherle
*/
@ImplementationsShouldExtend(AbstractSecretKey.class)
public interface SecretKey> extends Key {
/** Returns a protective copy of the secret data. */
@Nullable ByteBuffer getSecret();
/**
* Clears the current secret data and sets it to a protective copy of the
* given secret data.
*
* @param secret the secret data to copy and set.
*/
void setSecret(@Nullable ByteBuffer secret);
}