JWSOptions.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.utils.security;

  21. /**
  22.  * JWSOptions
  23.  *
  24.  * @author Bussu Giovanni (bussu@link.it)
  25.  * @author  $Author$
  26.  * @version $Rev$, $Date$
  27.  *
  28.  */
  29. public class JWSOptions {

  30.     private JOSESerialization serialization;
  31.     private boolean detached = false;   // https://tools.ietf.org/html/rfc7515#page-57 (utilizzabile sia per JSON che per COMPACT, rende inutile l'opzione payloadEncoding)
  32.     private boolean payloadEncoding = true;    // https://tools.ietf.org/html/rfc7797 (utilizzabile solamente per JSON. Per COMPACT è sconsigliato poichè limitato nei caratteri, non utilizzabile quindi per un json https://tools.ietf.org/html/rfc7797#page-8)
  33.    
  34.     public JWSOptions(JOSESerialization serialization) {
  35.         this.serialization = serialization;
  36.     }
  37.    
  38.     public JOSESerialization getSerialization() {
  39.         return this.serialization;
  40.     }
  41.     public void setSerialization(JOSESerialization serialization) {
  42.         this.serialization = serialization;
  43.     }
  44.     public boolean isDetached() {
  45.         return this.detached;
  46.     }
  47.     public void setDetached(boolean detached) {
  48.         this.detached = detached;
  49.     }
  50.     public boolean isPayloadEncoding() {
  51.         return this.payloadEncoding;
  52.     }
  53.     public void setPayloadEncoding(boolean payloadEncoding) {
  54.         this.payloadEncoding = payloadEncoding;
  55.     }
  56. }