Package com.storedobject.core
Class Secret
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Secret
- All Implemented Interfaces:
Displayable,StringFiller,HasId
Cipher keys used for encryption/decryption.
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefinition of the Master Key supplier. -
Field Summary
FieldsFields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidauthenticate(HTTP http, String user, String password) static Authenticatorauthenticator(String user, String password) static String[]static voidstatic byte[]static InputStreamdecrypt(InputStream encryptedStream, int keyIndex, SystemUser user) Decrypt the encrypted stream.static InputStreamdecrypt(InputStream encryptedStream, int keyIndex, TransactionManager tm) Decrypt the encrypted stream.static voiddecrypt(InputStream encryptedStream, OutputStream clearStream, int keyIndex, SystemUser user) Decrypt an encrypted stream and write it to an output stream.static voiddecrypt(InputStream encryptedStream, OutputStream clearStream, int keyIndex, TransactionManager tm) Decrypt an encrypted stream and write it to an output stream.static Stringdecrypt(String data, int keyIndex, SystemUser user) Decrypt data.static Stringdecrypt(String data, int keyIndex, TransactionManager tm) Decrypt data.static voidencrypt(InputStream clearStream, OutputStream encryptedStream, int keyIndex, SystemUser user) Encrypt a clear stream and write it to an output stream.static voidencrypt(InputStream clearStream, OutputStream encryptedStream, int keyIndex, TransactionManager tm) Encrypt a clear stream and write it to an output stream.static OutputStreamencrypt(OutputStream clearStream, int keyIndex, SystemUser user) Encrypt the encrypted stream.static OutputStreamencrypt(OutputStream clearStream, int keyIndex, TransactionManager tm) Encrypt the encrypted stream.static Stringencrypt(String data, int keyIndex, SystemUser user) Encrypt data.static Stringencrypt(String data, int keyIndex, TransactionManager tm) Encrypt data.static StringgeneratePassword(int length) static SecretKeyintintgetSeed()intgetType()static StringgetTypeValue(int type) static String[]Gets the unique index condition of this object.static inthints()static voidstatic String[]links()static Stringstatic voidMigrate Master Keys.static Stringstatic String[]voidsetComment(String comment) voidsetKeyIndex(int keyIndex) voidsetKeySerial(int keySerial) voidvoidsetSeedChecker(String seed) voidsetType(int type) voidThe system will invoke this whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getActor, getAttachment, getAttachmentId, getChildren, getContemporaryOf, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listDeletedIds, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loadAttributesFrom, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Field Details
-
AES
- See Also:
-
UNKNOWN_ALG
- See Also:
-
-
Constructor Details
-
Secret
public Secret()
-
-
Method Details
-
columns
-
browseColumns
-
protectedColumns
-
indices
-
getUniqueCondition
Description copied from class:StoredObjectGets the unique index condition of this object.- Overrides:
getUniqueConditionin classStoredObject- Returns:
- Unique index condition.
-
hints
public static int hints() -
links
-
setKeyIndex
public void setKeyIndex(int keyIndex) -
getKeyIndex
-
setSeed
-
getSeed
-
setSeedChecker
-
getSeedChecker
-
setType
public void setType(int type) -
getType
-
getTypeValues
-
getTypeValue
-
getTypeValue
-
setKeySerial
public void setKeySerial(int keySerial) -
getKeySerial
-
setComment
-
getComment
-
validateData
Description copied from class:StoredObjectThe system will invoke this whenever the object is saved to the DB. It will be invoked in all cases while creating new objects and updating/deleting/undeleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateDatain classStoredObject- Parameters:
tm- Current transaction manager.- Throws:
Exception- If data is invalid.
-
encrypt
Encrypt data.- Parameters:
data- Data to encrypt.keyIndex- Index of the key to be used.tm- Transaction manager.- Returns:
- Encrypted text.
-
encrypt
Encrypt data.- Parameters:
data- Data to encrypt.keyIndex- Index of the key to be used.user- Verified system user- Returns:
- Encrypted text.
-
decrypt
Decrypt data.- Parameters:
data- Data to decrypt.keyIndex- Index of the key to be used.tm- Transaction manager.- Returns:
- Decrypted text.
-
decrypt
Decrypt data.- Parameters:
data- Data to decrypt.keyIndex- Index of the key to be used.user- Verified system user- Returns:
- Decrypted text.
-
decrypt
public static InputStream decrypt(InputStream encryptedStream, int keyIndex, TransactionManager tm) throws IOException Decrypt the encrypted stream.- Parameters:
encryptedStream- Stream to decrypt.keyIndex- Index of the key to be used.tm- Transaction manager.- Returns:
- Decrypted stream.
- Throws:
IOException
-
decrypt
public static InputStream decrypt(InputStream encryptedStream, int keyIndex, SystemUser user) throws IOException Decrypt the encrypted stream.- Parameters:
encryptedStream- Stream to decrypt.keyIndex- Index of the key to be used.user- Verified system user- Returns:
- Decrypted stream.
- Throws:
IOException
-
encrypt
public static OutputStream encrypt(OutputStream clearStream, int keyIndex, TransactionManager tm) throws IOException Encrypt the encrypted stream.- Parameters:
clearStream- Stream to encrypt.keyIndex- Index of the key to be used.tm- Transaction manager.- Returns:
- Encrypted stream.
- Throws:
IOException
-
encrypt
public static OutputStream encrypt(OutputStream clearStream, int keyIndex, SystemUser user) throws IOException Encrypt the encrypted stream.- Parameters:
clearStream- Stream to encrypt.keyIndex- Index of the key to be used.user- Verified system user- Returns:
- Encrypted stream.
- Throws:
IOException
-
encrypt
public static void encrypt(InputStream clearStream, OutputStream encryptedStream, int keyIndex, TransactionManager tm) throws IOException Encrypt a clear stream and write it to an output stream.- Parameters:
clearStream- Clear stream to read from.encryptedStream- Encrypted output stream.keyIndex- Index of the key to be used.tm- Transaction manager.- Throws:
IOException- If any IO exception occurs.
-
encrypt
public static void encrypt(InputStream clearStream, OutputStream encryptedStream, int keyIndex, SystemUser user) throws IOException Encrypt a clear stream and write it to an output stream.- Parameters:
clearStream- Clear stream to read from.encryptedStream- Encrypted output stream.keyIndex- Index of the key to be used.user- Verified system user- Throws:
IOException- If any IO exception occurs.
-
decrypt
public static void decrypt(InputStream encryptedStream, OutputStream clearStream, int keyIndex, TransactionManager tm) throws IOException Decrypt an encrypted stream and write it to an output stream.- Parameters:
encryptedStream- Encrypted stream to read from.clearStream- Clear output stream.keyIndex- Index of the key to be used.tm- Transaction manager.- Throws:
IOException- If any IO exception occurs.
-
decrypt
public static void decrypt(InputStream encryptedStream, OutputStream clearStream, int keyIndex, SystemUser user) throws IOException Decrypt an encrypted stream and write it to an output stream.- Parameters:
encryptedStream- Encrypted stream to read from.clearStream- Clear output stream.keyIndex- Index of the key to be used.user- Verified system user- Throws:
IOException- If any IO exception occurs.
-
decrypt
-
migrateMasterKey
Migrate Master Keys.- Parameters:
tm- Transaction manager.- Throws:
Exception- If any error occurs.
-
generateSecretKey
-
obfuscate
-
authenticate
-
authenticator
-
log
-
generatePassword
-