001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2013-2015 ForgeRock AS. 015 */ 016 017package org.forgerock.json.jose.jwt; 018 019/** 020 * The interface represents the body of a JWT. 021 * <p> 022 * When the JWT is digitally signed or MACed, the bytes of the UTF-8 representation of the Payload are base64url 023 * encoded to create the Encoded JWS Payload. When the JWT is encrypted, the bytes of the UTF-8 representation of the 024 * Payload are used as the JWE Plaintext. 025 * 026 * @since 2.0.0 027 */ 028public interface Payload { 029 030 /** 031 * Builds the JWTs Payload into a <code>String</code> by following the steps specified in the relevant specification 032 * according to whether the JWT is being signed and/or encrypted. 033 * <p> 034 * @see <a href="http://tools.ietf.org/html/draft-jones-json-web-token-10#section-7"> 035 * JSON Web Token Specification</a> 036 * @see <a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11#section-5"> 037 * JSON Web Signature Specification</a> 038 * @see <a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-encryption-11#section-5"> 039 * JSON Web Encryption Specification</a> 040 * 041 * @return The base64url encoded UTF-8 representation of the JWTs Payload. 042 */ 043 String build(); 044}