io.jsonwebtoken.JwsHeader Maven / Gradle / Ivy
/*
* Copyright (C) 2014 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;
/**
* A JWS header.
*
* @since 0.1
*/
public interface JwsHeader extends ProtectedHeader {
/**
* JWS Algorithm Header name: the string literal alg
*
* @deprecated since 0.12.0 in favor of {@link #getAlgorithm()}
*/
@Deprecated
String ALGORITHM = "alg";
/**
* JWS JWK Set URL Header name: the string literal jku
*
* @deprecated since 0.12.0 in favor of {@link #getJwkSetUrl()}
*/
@Deprecated
String JWK_SET_URL = "jku";
/**
* JWS JSON Web Key Header name: the string literal jwk
*
* @deprecated since 0.12.0 in favor of {@link #getJwk()}
*/
@Deprecated
String JSON_WEB_KEY = "jwk";
/**
* JWS Key ID Header name: the string literal kid
*
* @deprecated since 0.12.0 in favor of {@link #getKeyId()}
*/
@Deprecated
String KEY_ID = "kid";
/**
* JWS X.509 URL Header name: the string literal x5u
*
* @deprecated since 0.12.0 in favor of {@link #getX509Url()}
*/
@Deprecated
String X509_URL = "x5u";
/**
* JWS X.509 Certificate Chain Header name: the string literal x5c
*
* @deprecated since 0.12.0 in favor of {@link #getX509Chain()}
*/
@Deprecated
String X509_CERT_CHAIN = "x5c";
/**
* JWS X.509 Certificate SHA-1 Thumbprint Header name: the string literal x5t
*
* @deprecated since 0.12.0 in favor of {@link #getX509Sha1Thumbprint()}
*/
@Deprecated
String X509_CERT_SHA1_THUMBPRINT = "x5t";
/**
* JWS X.509 Certificate SHA-256 Thumbprint Header name: the string literal x5t#S256
*
* @deprecated since 0.12.0 in favor of {@link #getX509Sha256Thumbprint()}
*/
@Deprecated
String X509_CERT_SHA256_THUMBPRINT = "x5t#S256";
/**
* JWS Critical Header name: the string literal crit
*
* @deprecated since 0.12.0 in favor of {@link #getCritical()}
*/
@Deprecated
String CRITICAL = "crit";
/**
* Returns {@code true} if the payload is Base64Url-encoded per standard JWS rules, or {@code false} if the
* RFC 7797: JSON Web Signature (JWS) Unencoded Payload
* Option has been specified.
*
* @return {@code true} if the payload is Base64Url-encoded per standard JWS rules, or {@code false} if the
* RFC 7797: JSON Web Signature (JWS) Unencoded Payload
* Option has been specified.
*/
boolean isPayloadEncoded();
}