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 2016 ForgeRock AS.
015 */
016
017package org.forgerock.json.jose.jws;
018
019import org.forgerock.json.jose.jwe.EncryptedJwt;
020import org.forgerock.json.jose.jws.handlers.SigningHandler;
021
022/**
023 * A nested encrypted and then signed JWT.
024 *
025 * @deprecated Use {@link EncryptedThenSignedJwt} instead.
026 */
027@Deprecated
028public class SignedEncryptedJwt extends EncryptedThenSignedJwt {
029
030    /**
031     * Constructs a fresh, new SignedEncryptedJwt from the given JwsHeader and nested Encrypted JWT.
032     * <p>
033     * The specified private key will be used in the creation of the JWS signature.
034     *
035     * @param header The JwsHeader containing the header parameters of the JWS.
036     * @param nestedJwe The nested Encrypted JWT that will be the payload of this JWS.
037     * @param signingHandler The SigningHandler instance used to sign the JWS.
038     */
039    public SignedEncryptedJwt(final JwsHeader header, final EncryptedJwt nestedJwe,
040            final SigningHandler signingHandler) {
041        super(header, nestedJwe, signingHandler);
042    }
043
044    /**
045     * Constructs a reconstructed SignedEncryptedJwt from its constituent parts, the JwsHeader, nested Encrypted JWT,
046     * signing input and signature.
047     * <p>
048     * For use when a signed nested encrypted JWT has been reconstructed from its base64url encoded string
049     * representation and the signature needs verifying.
050     *
051     * @param header The JwsHeader containing the header parameters of the JWS.
052     * @param nestedJwe The nested Encrypted JWT that is the payload of the JWS.
053     * @param signingInput The original data that was signed, being the base64url encoding of the JWS header and
054     *                     payload concatenated using a "." character.
055     * @param signature The resulting signature of signing the signing input.
056     */
057    public SignedEncryptedJwt(final JwsHeader header, final EncryptedJwt nestedJwe, final byte[] signingInput,
058            final byte[] signature) {
059        super(header, nestedJwe, signingInput, signature);
060    }
061}