gluu
公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.model.jwe.AbstractJweDecrypter クラスabstract
org.xdi.oxauth.model.jwe.AbstractJweDecrypter の継承関係図
Inheritance graph
org.xdi.oxauth.model.jwe.AbstractJweDecrypter 連携図
Collaboration graph

公開メンバ関数

KeyEncryptionAlgorithm getKeyEncryptionAlgorithm ()
 
void setKeyEncryptionAlgorithm (KeyEncryptionAlgorithm keyEncryptionAlgorithm)
 
BlockEncryptionAlgorithm getBlockEncryptionAlgorithm ()
 
void setBlockEncryptionAlgorithm (BlockEncryptionAlgorithm blockEncryptionAlgorithm)
 
Jwe decrypt (String encryptedJwe) throws InvalidJweException
 
abstract byte [] decryptEncryptionKey (String encodedEncryptedKey) throws InvalidJweException
 
abstract String decryptCipherText (String encodedCipherText, byte[] contentMasterKey, byte[] initializationVector, byte[] authenticationTag, byte[] additionalAuthenticatedData) throws InvalidJweException
 

非公開変数類

KeyEncryptionAlgorithm keyEncryptionAlgorithm
 
BlockEncryptionAlgorithm blockEncryptionAlgorithm
 

詳解

著者
Javier Rojas Blum
バージョン
July 31, 2016

関数詳解

◆ decrypt()

Jwe org.xdi.oxauth.model.jwe.AbstractJweDecrypter.decrypt ( String  encryptedJwe) throws InvalidJweException
inline

org.xdi.oxauth.model.jwe.JweDecrypterを実装しています。

48  {
49  try {
50  if (StringUtils.isBlank(encryptedJwe)) {
51  return null;
52  }
53 
54  String[] jweParts = encryptedJwe.split("\\.");
55  if (jweParts.length != 5) {
56  throw new InvalidJwtException("Invalid JWS format.");
57  }
58 
59  String encodedHeader = jweParts[0];
60  String encodedEncryptedKey = jweParts[1];
61  String encodedInitializationVector = jweParts[2];
62  String encodedCipherText = jweParts[3];
63  String encodedIntegrityValue = jweParts[4];
64 
65  Jwe jwe = new Jwe();
66  jwe.setEncodedHeader(encodedHeader);
67  jwe.setEncodedEncryptedKey(encodedEncryptedKey);
68  jwe.setEncodedInitializationVector(encodedInitializationVector);
69  jwe.setEncodedCiphertext(encodedCipherText);
70  jwe.setEncodedIntegrityValue(encodedIntegrityValue);
71 
72  jwe.setHeader(new JwtHeader(encodedHeader));
73 
74  keyEncryptionAlgorithm = KeyEncryptionAlgorithm.fromName(
75  jwe.getHeader().getClaimAsString(JwtHeaderName.ALGORITHM));
76  blockEncryptionAlgorithm = BlockEncryptionAlgorithm.fromName(
77  jwe.getHeader().getClaimAsString(JwtHeaderName.ENCRYPTION_METHOD));
78 
79  byte[] contentMasterKey = decryptEncryptionKey(encodedEncryptedKey);
80  byte[] initializationVector = Base64Util.base64urldecode(encodedInitializationVector);
81  byte[] authenticationTag = Base64Util.base64urldecode(encodedIntegrityValue);
82  byte[] additionalAuthenticatedData = jwe.getAdditionalAuthenticatedData().getBytes(Util.UTF8_STRING_ENCODING);
83 
84  String plainText = decryptCipherText(encodedCipherText, contentMasterKey, initializationVector,
85  authenticationTag, additionalAuthenticatedData);
86  jwe.setClaims(new JwtClaims(plainText));
87 
88  return jwe;
89  } catch (InvalidJwtException e) {
90  throw new InvalidJweException(e);
91  } catch (UnsupportedEncodingException e) {
92  throw new InvalidJweException(e);
93  }
94  }
abstract String decryptCipherText(String encodedCipherText, byte[] contentMasterKey, byte[] initializationVector, byte[] authenticationTag, byte[] additionalAuthenticatedData)
BlockEncryptionAlgorithm blockEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:29
static BlockEncryptionAlgorithm fromName(String name)
Definition: BlockEncryptionAlgorithm.java:83
abstract byte [] decryptEncryptionKey(String encodedEncryptedKey)
KeyEncryptionAlgorithm keyEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:28
static KeyEncryptionAlgorithm fromName(String name)
Definition: KeyEncryptionAlgorithm.java:51

◆ decryptCipherText()

abstract String org.xdi.oxauth.model.jwe.AbstractJweDecrypter.decryptCipherText ( String  encodedCipherText,
byte []  contentMasterKey,
byte []  initializationVector,
byte []  authenticationTag,
byte []  additionalAuthenticatedData 
) throws InvalidJweException
abstract

◆ decryptEncryptionKey()

abstract byte [] org.xdi.oxauth.model.jwe.AbstractJweDecrypter.decryptEncryptionKey ( String  encodedEncryptedKey) throws InvalidJweException
abstract

◆ getBlockEncryptionAlgorithm()

BlockEncryptionAlgorithm org.xdi.oxauth.model.jwe.AbstractJweDecrypter.getBlockEncryptionAlgorithm ( )
inline

org.xdi.oxauth.model.jwe.JweDecrypterを実装しています。

39  {
41  }
BlockEncryptionAlgorithm blockEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:29

◆ getKeyEncryptionAlgorithm()

KeyEncryptionAlgorithm org.xdi.oxauth.model.jwe.AbstractJweDecrypter.getKeyEncryptionAlgorithm ( )
inline

org.xdi.oxauth.model.jwe.JweDecrypterを実装しています。

31  {
33  }
KeyEncryptionAlgorithm keyEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:28

◆ setBlockEncryptionAlgorithm()

void org.xdi.oxauth.model.jwe.AbstractJweDecrypter.setBlockEncryptionAlgorithm ( BlockEncryptionAlgorithm  blockEncryptionAlgorithm)
inline

org.xdi.oxauth.model.jwe.JweDecrypterを実装しています。

43  {
45  }
BlockEncryptionAlgorithm blockEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:29

◆ setKeyEncryptionAlgorithm()

void org.xdi.oxauth.model.jwe.AbstractJweDecrypter.setKeyEncryptionAlgorithm ( KeyEncryptionAlgorithm  keyEncryptionAlgorithm)
inline

org.xdi.oxauth.model.jwe.JweDecrypterを実装しています。

35  {
37  }
KeyEncryptionAlgorithm keyEncryptionAlgorithm
Definition: AbstractJweDecrypter.java:28

メンバ詳解

◆ blockEncryptionAlgorithm

BlockEncryptionAlgorithm org.xdi.oxauth.model.jwe.AbstractJweDecrypter.blockEncryptionAlgorithm
private

◆ keyEncryptionAlgorithm

KeyEncryptionAlgorithm org.xdi.oxauth.model.jwe.AbstractJweDecrypter.keyEncryptionAlgorithm
private

このクラス詳解は次のファイルから抽出されました: