io.jsonwebtoken.security.SecureDigestAlgorithm Maven / Gradle / Ivy
/*
* Copyright © 2022 jsonwebtoken.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jsonwebtoken.security;
import io.jsonwebtoken.Identifiable;
import java.io.InputStream;
import java.security.Key;
/**
* A {@link DigestAlgorithm} that requires a {@link Key} to compute and verify the authenticity of digests using either
* digital signature or
* message
* authentication code algorithms.
*
* Standard Identifier
*
* {@code SecureDigestAlgorithm} extends {@link Identifiable}: when a {@code SecureDigestAlgorithm} is used to
* compute the digital signature or MAC of a JWS, the value returned from
* {@link Identifiable#getId() secureDigestAlgorithm.getId()} will be set as the JWS
* "alg"
protected header value.
*
* Standard Implementations
*
* Constant definitions and utility methods for all JWA (RFC 7518) standard
* Cryptographic Algorithms for Digital Signatures and
* MACs are available via {@link io.jsonwebtoken.Jwts.SIG Jwts.SIG}.
*
* "alg" identifier
*
* {@code SecureDigestAlgorithm} extends {@link Identifiable}: the value returned from
* {@link Identifiable#getId() getId()} will be used as the JWS "alg" protected header value.
*
* @param the type of {@link Key} used to create digital signatures or message authentication codes
* @param the type of {@link Key} used to verify digital signatures or message authentication codes
* @see MacAlgorithm
* @see SignatureAlgorithm
* @since 0.12.0
*/
public interface SecureDigestAlgorithm
extends DigestAlgorithm, VerifySecureDigestRequest> {
}