public class EncryptionUtils
extends java.lang.Object
コンストラクタと説明 |
---|
EncryptionUtils() |
修飾子とタイプ | メソッドと説明 |
---|---|
static EncryptionInstruction |
buildInstructionFromInstructionFile(NcsObject instructionFile,
EncryptionKeyMaterials materials,
java.security.Provider cryptoProvider)
InstructionFileからEncryptionInstructionオブジェクトを生成します。
|
static EncryptionInstruction |
buildInstructionFromMetadata(NcsObject object,
EncryptionKeyMaterials materials,
java.security.Provider cryptoProvider)
メタデータからInstructionオブジェクトを生成します。
|
static long |
calculateCryptoContentLength(javax.crypto.Cipher symmetricCipher,
NcsObject object)
暗号化後のデータサイズを算出します。
|
static byte[] |
computeInstructionFileSHA256(EncryptionInstruction instruction)
InstructionファイルのSHA256ハッシュ値を計算します
オブジェクト名
|
static java.lang.String |
convertInstructionToJSONString(EncryptionInstruction instruction)
EncryptionInstructionをJSON形式の文字列に変換します。
|
static NcsObject |
createInstructionRequestObject(java.lang.String bucketName,
java.lang.String objectName,
EncryptionInstruction instruction)
Instructionファイルの情報を含むNcsObjcetを生成します。
|
static javax.crypto.Cipher |
createSymmetricCipher(javax.crypto.SecretKey symmetricKey,
int encryptMode,
java.security.Provider cryptoProvider,
byte[] initVector)
対称鍵と初期化ベクトル、モードを指定して、対称鍵暗号を作成します。
|
static NcsObject |
decryptObjectUsingInstruction(NcsObject object,
EncryptionInstruction instruction)
Instructionファイルを使用してオブジェクトデータを復号化します。
|
static EncryptionInstruction |
generateInstruction(EncryptionKeyMaterials materials,
java.security.Provider cryptoProvider)
EncryptionInstructionオブジェクトを生成します。
|
static javax.crypto.SecretKey |
generateOneTimeUseSymmetricKey()
暗号化に使用するワンタイム・キーを生成します。
|
static long[] |
getAdjustedCryptoRange(long[] range)
暗号化のために調整されたrangeを返却します。
|
static java.io.InputStream |
getEncryptedInputStream(java.io.InputStream input,
javax.crypto.Cipher symmetricCipher)
指定した暗号で暗号化されたオブジェクトデータのストリームを取得します。
|
static byte[] |
getEncryptedSymmetricKey(javax.crypto.SecretKey toBeEncrypted,
EncryptionKeyMaterials materials,
java.security.Provider cryptoProvider)
秘密鍵により暗号化された対称鍵のバイト列を取得します。
|
static NcsObject |
getRangeAdjustedObject(NcsObject object,
long[] range)
暗号化のためにオブジェクトデータのrangeを調整したNcsObjectを返却します。
|
static boolean |
isEncryptionInfoInInstructionFile(NcsObject instructionFile)
暗号化情報がInstructionファイルに含まれるかどうかの判定を行います。
|
static boolean |
isEncryptionInfoInMetadata(NcsObject object)
暗号化情報がメタデータに含まれるかどうかの判定を行います。
|
static void |
updateMetadataWithEncryptionInstruction(NcsObject object,
EncryptionInstruction instruction)
Instructionファイルの内容をメタデータに反映します。
|
public static EncryptionInstruction generateInstruction(EncryptionKeyMaterials materials, java.security.Provider cryptoProvider)
materials
- 暗号鍵情報cryptoProvider
- 暗号化プロバイダーpublic static EncryptionInstruction buildInstructionFromInstructionFile(NcsObject instructionFile, EncryptionKeyMaterials materials, java.security.Provider cryptoProvider)
instructionFile
- 暗号化情報materials
- 暗号鍵情報cryptoProvider
- 暗号化プロバイダーpublic static EncryptionInstruction buildInstructionFromMetadata(NcsObject object, EncryptionKeyMaterials materials, java.security.Provider cryptoProvider)
object
- メタデータを含むNcsObjectmaterials
- 暗号鍵情報cryptoProvider
- 暗号化プロバイダーpublic static NcsObject decryptObjectUsingInstruction(NcsObject object, EncryptionInstruction instruction)
object
- 複合化するNcsObjectinstruction
- 暗号化情報public static boolean isEncryptionInfoInInstructionFile(NcsObject instructionFile)
instructionFile
- Instructionファイルpublic static boolean isEncryptionInfoInMetadata(NcsObject object)
object
- 対象のNcsObjcetpublic static long[] getAdjustedCryptoRange(long[] range)
range
- オブジェクトの取得範囲public static NcsObject getRangeAdjustedObject(NcsObject object, long[] range)
object
- 範囲調整の対象となるNcsObjectrange
- 取得範囲public static javax.crypto.SecretKey generateOneTimeUseSymmetricKey()
public static javax.crypto.Cipher createSymmetricCipher(javax.crypto.SecretKey symmetricKey, int encryptMode, java.security.Provider cryptoProvider, byte[] initVector)
symmetricKey
- 対称鍵encryptMode
- 暗号化モードcryptoProvider
- 暗号化プロバイダーinitVector
- 初期化ベクトルpublic static byte[] getEncryptedSymmetricKey(javax.crypto.SecretKey toBeEncrypted, EncryptionKeyMaterials materials, java.security.Provider cryptoProvider)
toBeEncrypted
- 暗号化の対象となる対称鍵materials
- 暗号鍵情報cryptoProvider
- 暗号化プロバイダーpublic static java.io.InputStream getEncryptedInputStream(java.io.InputStream input, javax.crypto.Cipher symmetricCipher)
input
- 暗号化の対象となる入力ストリームsymmetricCipher
- 対称暗号public static void updateMetadataWithEncryptionInstruction(NcsObject object, EncryptionInstruction instruction)
object
- 対象となるNcsObjectinstruction
- 暗号化情報public static long calculateCryptoContentLength(javax.crypto.Cipher symmetricCipher, NcsObject object)
symmetricCipher
- 対称暗号object
- 対象となるNcsObjectpublic static NcsObject createInstructionRequestObject(java.lang.String bucketName, java.lang.String objectName, EncryptionInstruction instruction)
bucketName
- バケット名objectName
- オブジェクト名instruction
- 暗号化情報public static byte[] computeInstructionFileSHA256(EncryptionInstruction instruction)
instruction
- 暗号化情報public static java.lang.String convertInstructionToJSONString(EncryptionInstruction instruction)
instruction
- 暗号化情報