001package com.box.sdkgen.internal.utils; 002 003import com.box.sdkgen.serialization.json.EnumWrapper; 004 005public class JwtSignOptions { 006 protected JwtAlgorithm algorithm; 007 protected String audience; 008 protected String issuer; 009 protected String subject; 010 protected String jwtid; 011 protected String keyid; 012 protected PrivateKeyDecryptor privateKeyDecryptor; 013 014 public JwtSignOptions( 015 JwtAlgorithm algorithm, 016 String audience, 017 String issuer, 018 String subject, 019 String jwtid, 020 String keyid) { 021 this(algorithm, audience, issuer, subject, jwtid, keyid, new DefaultPrivateKeyDecryptor()); 022 } 023 024 public JwtSignOptions( 025 EnumWrapper<JwtAlgorithm> algorithm, 026 String audience, 027 String issuer, 028 String subject, 029 String jwtid, 030 String keyid) { 031 this(algorithm, audience, issuer, subject, jwtid, keyid, new DefaultPrivateKeyDecryptor()); 032 } 033 034 public JwtSignOptions( 035 JwtAlgorithm algorithm, 036 String audience, 037 String issuer, 038 String subject, 039 String jwtid, 040 String keyid, 041 PrivateKeyDecryptor privateKeyDecryptor) { 042 this.algorithm = algorithm; 043 this.audience = audience; 044 this.issuer = issuer; 045 this.subject = subject; 046 this.jwtid = jwtid; 047 this.keyid = keyid; 048 this.privateKeyDecryptor = privateKeyDecryptor; 049 } 050 051 public JwtSignOptions( 052 EnumWrapper<JwtAlgorithm> algorithm, 053 String audience, 054 String issuer, 055 String subject, 056 String jwtid, 057 String keyid, 058 PrivateKeyDecryptor privateKeyDecryptor) { 059 this.algorithm = algorithm.getEnumValue(); 060 this.audience = audience; 061 this.issuer = issuer; 062 this.subject = subject; 063 this.jwtid = jwtid; 064 this.keyid = keyid; 065 this.privateKeyDecryptor = privateKeyDecryptor; 066 } 067 068 public JwtAlgorithm getAlgorithm() { 069 return algorithm; 070 } 071 072 public String getAudience() { 073 return audience; 074 } 075 076 public String getIssuer() { 077 return issuer; 078 } 079 080 public String getSubject() { 081 return subject; 082 } 083 084 public String getJwtid() { 085 return jwtid; 086 } 087 088 public String getKeyid() { 089 return keyid; 090 } 091 092 public PrivateKeyDecryptor getPrivateKeyDecryptor() { 093 return privateKeyDecryptor; 094 } 095}