public class BasicDICOMMediaSecurityProfile
extends java.lang.Object
| Constructor and Description |
|---|
BasicDICOMMediaSecurityProfile() |
| Modifier and Type | Method and Description |
|---|---|
void |
decryptDICOMFileSet(java.lang.String strSecureDICOMDIRPath,
java.lang.String strSourceDICOMDIRPath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
This method decrypts the DICOMDIR file set and generates original DICOM file-set.
|
void |
decryptSecureDICOMFile(java.lang.String strSecureDICOMFilePath,
java.lang.String strDICOMFilePath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
This method decrypts the secure DICOM file according to the profile algorithm , key and initializing vector provided to it.
|
void |
encryptDICOMFile(java.lang.String strDICOMFilePath,
java.lang.String strSecureDICOMFilePath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
This method encrypts the DICOM file and dumped it on destination path provided as secure dicom file path.
|
void |
encryptDICOMFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strSecureDICOMDIRPath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
This method encrypts the DICOMDIR file set and generates secure dicom file-set.
|
void |
generateDigest(DicomStream objSourceDataStream,
DicomStream objDestDataStream)
Generates digest(hash code) for data available on source stream.
|
void |
generateDigest(java.lang.String strSecureDICOMFile,
java.lang.String strDigestPath)
Generates digest(hash code) for file provided and accordingly dump it on given path.
|
void |
generateDigestForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strDigestDIR,
java.lang.String strDigestSuffix)
This method generates digest for each file in DICOMDIR file set.
|
void |
generateSignature(java.lang.String strSecureDICOMFile,
java.lang.String strDigitalSignaturePath,
java.security.PrivateKey objPrivateKey)
Generates the Digital Signature for provided secure file and dump it on given location.
|
void |
generateSignForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strSignatureDIR,
java.security.PrivateKey objPrivateKey,
java.lang.String strSignSuffix)
This method generates digital signature for each file in DICOMDIR file set.
|
boolean |
verifyDigest(DicomStream objSourceDataStream,
DicomStream objDigestDataStream)
Verifies digest(hash code) provided on given stream for source data available on source data stream.
|
boolean |
verifyDigest(java.lang.String strSecureDICOMFile,
java.lang.String strDigestPath)
Verifies digest(hash code) provided on given location according to the secure dicom file specified
In digest generation it uses SHA1 algorithm.
|
IPairedCollection<java.lang.String,java.lang.Boolean> |
verifyDigestForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strDigestDIR,
java.lang.String strDigestSuffix)
This method verifies digest for each file in DICOMDIR file set.
|
boolean |
verifySignature(DicomStream objSourceDataStream,
DicomStream objExistingSignStream,
java.security.PublicKey objPublicKey)
Verifies the DigitalSignature provided on stream for source data available on source data stream
In verification of Digital Signature it uses public key provided to it and SHA-1 as the digest algorithm.
|
boolean |
verifySignature(java.lang.String strSecureDICOMFile,
java.lang.String strDigitalSignaturePath,
java.security.PublicKey objPublicKey)
Verifies the DigitalSignature specified according to the provided secure DICOM file.
|
IPairedCollection<java.lang.String,java.lang.Boolean> |
verifySignForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strSignatureDIR,
java.security.PublicKey objPublicKey,
java.lang.String strSignSuffix)
This method verifies digital signature for each file in DICOMDIR file set.
|
public void encryptDICOMFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strSecureDICOMDIRPath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException,
java.security.InvalidAlgorithmParameterException
strSourceDICOMDIRPath - path to the directory which contains DICOMDIR file and other images in DICOMDIR format
name of DICOMDIR file should not be includedstrSecureDICOMDIRPath - path to the directory where encrypted files will be stored in DICOMDIR structure.enumProfileAlgorithm - - Encryption Algorithm that is to be used.objKey - - Key that is to be used for the encryption of Data ELements.objIV - - value of initializing vectorjava.io.IOException - Signals if IO Operation Fails.java.security.NoSuchAlgorithmException - Signal is Encryption of the Data Set Fails.javax.crypto.NoSuchPaddingException - Signal is Encryption of the Data Set Fails.java.security.InvalidKeyException - Signal is Encryption of the Data Set Fails.javax.crypto.IllegalBlockSizeException - Signal is Encryption of the Data Set Fails.javax.crypto.BadPaddingException - Signal is Encryption of the Data Set Fails.java.security.InvalidAlgorithmParameterException - signal if algorithm parameter are not validpublic void encryptDICOMFile(java.lang.String strDICOMFilePath,
java.lang.String strSecureDICOMFilePath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException,
java.security.InvalidAlgorithmParameterException
strDICOMFilePath - value of DICOM file path which need to be converted in secure DICOM file.strSecureDICOMFilePath - value of secure DICOM file path.enumProfileAlgorithm - - Encryption Algorithm that is to be used.objKey - - Key that is to be used for the encryption of Data ELements.objIV - - value of initializing vectorjava.io.IOException - Signals if IO Operation Fails.java.security.NoSuchAlgorithmException - Signal is Encryption of the Data Set Fails.javax.crypto.NoSuchPaddingException - Signal is Encryption of the Data Set Fails.java.security.InvalidKeyException - Signal is Encryption of the Data Set Fails.javax.crypto.IllegalBlockSizeException - Signal is Encryption of the Data Set Fails.javax.crypto.BadPaddingException - Signal is Encryption of the Data Set Fails.java.security.InvalidAlgorithmParameterException - signal if algorithm param are not validpublic void decryptDICOMFileSet(java.lang.String strSecureDICOMDIRPath,
java.lang.String strSourceDICOMDIRPath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException,
java.security.InvalidAlgorithmParameterException
strSecureDICOMDIRPath - path to the directory which contains DICOMDIR file and other encrypted images which need to be decrypted.
name of DICOMDIR file should not be includedstrSourceDICOMDIRPath - path to the directory where decrypted files will be stored.enumProfileAlgorithm - Algorithm that is to be used.objKey - Key that is to be used for the decrption of Data ELements.objIV - value of initializing vectorjava.io.IOException - Signals if IO Operation Fails.java.security.NoSuchAlgorithmException - Signal is decrption of the Data Set Fails.javax.crypto.NoSuchPaddingException - Signal is decrption of the Data Set Fails.java.security.InvalidKeyException - Signal is decrption of the Data Set Fails.javax.crypto.IllegalBlockSizeException - Signal is decrption of the Data Set Fails.javax.crypto.BadPaddingException - Signal is decrption of the Data Set Fails.java.security.InvalidAlgorithmParameterException - signal if algorithm parameter are not validpublic void decryptSecureDICOMFile(java.lang.String strSecureDICOMFilePath,
java.lang.String strDICOMFilePath,
EnumProfileAlgorithm enumProfileAlgorithm,
byte[] objKey,
byte[] objIV)
throws java.io.IOException,
java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException,
java.security.InvalidAlgorithmParameterException
strSecureDICOMFilePath - path to secure DICOM file which need to be decrypted in original DICOM file.strDICOMFilePath - path where decrypted original DICOM file will be serializedenumProfileAlgorithm - Algorithm that is to be used.objKey - Key that is to be used for the decrption of Data ELements.objIV - value of initializing vectorjava.io.IOException - Signals if IO Operation Fails.java.security.NoSuchAlgorithmException - Signal is decrption of the Data Set Fails.javax.crypto.NoSuchPaddingException - Signal is decrption of the Data Set Fails.java.security.InvalidKeyException - Signal is decrption of the Data Set Fails.javax.crypto.IllegalBlockSizeException - Signal is decrption of the Data Set Fails.javax.crypto.BadPaddingException - Signal is decrption of the Data Set Fails.java.security.InvalidAlgorithmParameterException - signal if algorithm param are not validpublic void generateSignForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strSignatureDIR,
java.security.PrivateKey objPrivateKey,
java.lang.String strSignSuffix)
throws java.security.InvalidKeyException,
java.io.FileNotFoundException,
java.io.IOException,
java.security.SignatureException,
java.security.NoSuchAlgorithmException
strSourceDICOMDIRPath - path to the directory which contains DICOMDIR file and other images for which signature need to be generated.
name of DICOMDIR file should not be includedstrSignatureDIR - path to the directory where new generated signatures will be stored.objPrivateKey - instance of private key.strSignSuffix - suffix value which will be concatenated with image file name to generate name of signature file.java.security.InvalidKeyException - if key provided to it is invalid.java.io.FileNotFoundException - if specified file is not found.java.io.IOException - if input/output operation fails.java.security.SignatureException - if signature generation fails.java.security.NoSuchAlgorithmException - if algorithm specified is invalid.public void generateSignature(java.lang.String strSecureDICOMFile,
java.lang.String strDigitalSignaturePath,
java.security.PrivateKey objPrivateKey)
throws java.security.InvalidKeyException,
java.io.FileNotFoundException,
java.io.IOException,
java.security.SignatureException,
java.security.NoSuchAlgorithmException
strSecureDICOMFile - path to secure DICOM file.strDigitalSignaturePath - path where generated signature will be dumped.objPrivateKey - instance of private key.java.security.InvalidKeyException - if key provided to it is invalid.java.io.FileNotFoundException - if specified file is not found.java.io.IOException - if input/output operation fails.java.security.SignatureException - if signature generation fails.java.security.NoSuchAlgorithmException - if algorithm specified is invalid.public IPairedCollection<java.lang.String,java.lang.Boolean> verifySignForFileSet(java.lang.String strSourceDICOMDIRPath, java.lang.String strSignatureDIR, java.security.PublicKey objPublicKey, java.lang.String strSignSuffix) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.io.FileNotFoundException, java.io.IOException, java.security.SignatureException
strSourceDICOMDIRPath - path to the directory which contains DICOMDIR file and other images for which signature need to be verified.
name of DICOMDIR file should not be includedstrSignatureDIR - path to the directory where original signatures are stored.objPublicKey - instance of public key.strSignSuffix - suffix value which will be concatenated with image file name to generate name of signature file.java.security.InvalidKeyException - if key provided to it is invalid.java.io.FileNotFoundException - if specified file is not found.java.io.IOException - if input/output operation fails.java.security.SignatureException - if signature generation fails.java.security.NoSuchAlgorithmException - if algorithm specified is invalid.public boolean verifySignature(java.lang.String strSecureDICOMFile,
java.lang.String strDigitalSignaturePath,
java.security.PublicKey objPublicKey)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.io.FileNotFoundException,
java.io.IOException,
java.security.SignatureException
strSecureDICOMFile - path to secure DICOM file.strDigitalSignaturePath - path where generated signature will be dumped.objPublicKey - instance of public key.java.security.InvalidKeyException - if key provided to it is invalid.java.io.FileNotFoundException - if specified file is not found.java.io.IOException - if input/output operation fails.java.security.SignatureException - if signature generation fails.java.security.NoSuchAlgorithmException - if algorithm specified is invalid.public boolean verifySignature(DicomStream objSourceDataStream, DicomStream objExistingSignStream, java.security.PublicKey objPublicKey) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.io.IOException, java.security.SignatureException
objSourceDataStream - stream containing source dataobjExistingSignStream - stream which contains digital signatureobjPublicKey - instance of public key.java.security.InvalidKeyException - if key provided to it is invalid.java.io.IOException - if input/output operation fails.java.security.SignatureException - if signature generation fails.java.security.NoSuchAlgorithmException - if algorithm specified is invalid.public void generateDigestForFileSet(java.lang.String strSourceDICOMDIRPath,
java.lang.String strDigestDIR,
java.lang.String strDigestSuffix)
throws java.security.NoSuchAlgorithmException,
java.io.FileNotFoundException,
java.io.IOException
strSourceDICOMDIRPath - path to the directory which contains DICOMDIR file and other images for which digest need to be generated.
name of DICOMDIR file should not be includedstrDigestDIR - path to the directory where new generated digest files will be stored.strDigestSuffix - suffix value which will be concatenated with image file name to generate name of digest file.java.io.FileNotFoundException - if specified file path is invalidjava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalidpublic void generateDigest(java.lang.String strSecureDICOMFile,
java.lang.String strDigestPath)
throws java.security.NoSuchAlgorithmException,
java.io.FileNotFoundException,
java.io.IOException
strSecureDICOMFile - path to secure dicom file for which digest(hash code) need to be generated.strDigestPath - path where generated digest(hash code) will be dumped.java.io.FileNotFoundException - if specified file path is invalidjava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalidpublic void generateDigest(DicomStream objSourceDataStream, DicomStream objDestDataStream) throws java.security.NoSuchAlgorithmException, java.io.IOException
objSourceDataStream - stream containing source dataobjDestDataStream - stream on which generated digest will be serializedjava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalidpublic IPairedCollection<java.lang.String,java.lang.Boolean> verifyDigestForFileSet(java.lang.String strSourceDICOMDIRPath, java.lang.String strDigestDIR, java.lang.String strDigestSuffix) throws java.security.NoSuchAlgorithmException, java.io.FileNotFoundException, java.io.IOException
strSourceDICOMDIRPath - path to the directory which contains DICOMDIR file and other images for which digest need to be verified.
name of DICOMDIR file should not be includedstrDigestDIR - path to the directory where original digest files are stored.strDigestSuffix - suffix value which will be concatenated with image file name to generate name of digest file.java.io.FileNotFoundException - if specified file path is invalidjava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalidpublic boolean verifyDigest(java.lang.String strSecureDICOMFile,
java.lang.String strDigestPath)
throws java.security.NoSuchAlgorithmException,
java.io.FileNotFoundException,
java.io.IOException
strSecureDICOMFile - path to secure dicom file for which digest(hash code) need to be generated.strDigestPath - path where generated digest(hash code) will be dumped.java.io.FileNotFoundException - if specified file path is invalidjava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalidpublic boolean verifyDigest(DicomStream objSourceDataStream, DicomStream objDigestDataStream) throws java.security.NoSuchAlgorithmException, java.io.IOException
objSourceDataStream - stream containing source dataobjDigestDataStream - stream containing digest datajava.io.IOException - if input/output operation failsjava.security.NoSuchAlgorithmException - if algorithm specified is invalid