Package com.iizix.prop
Class PKCS12IdentityProp
- java.lang.Object
- com.iizix.prop.GProp<byte[]>
- com.iizix.prop.ByteArrayProp
- com.iizix.prop.PKCS12IdentityProp
 
 
 
- All Implemented Interfaces:
- EventListener,- IGProp<byte[]>,- java.lang.Cloneable
 - public class PKCS12IdentityProp extends ByteArrayProp The PKCS#12 Identity Property used for SSL communication or code signing.- Author:
- Christopher Mindus
 
- Field Summary- Fields inherited from class com.iizix.prop.GProp- GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
 - Fields inherited from interface com.iizix.prop.IGProp- EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
 
 - Constructor Summary- Constructors - Modifier - Constructor - Description - protected- PKCS12IdentityProp()Creates a byte array property with the specified name with a null value.- PKCS12IdentityProp(Atom propertyAtom)Creates a byte array property with the specified name with a null value.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - PKCS12IdentityProp- clone()Clones the byte array property.- java.lang.String- getIdentityDescription()Gets the description of the identity.- javax.net.ssl.KeyManager[]- getKeyManagers(char[] password)Gets the Key Managers for the identity, a class representing a storage facility for cryptographic keys and certificates.- java.security.KeyStore- getKeyStore(char[] password)Gets the KeyStore for the identity.- boolean- setIdentity(java.lang.String fileName, char[] password)Sets the identity.- void- setKeyStore(java.security.KeyStore keyStore, char[] password, java.lang.String descr)Stores the keystore along with a description of it.- boolean- setPropValue(byte[] newValue)Sets a new value for this property.- Methods inherited from class com.iizix.prop.ByteArrayProp- appendPropValue, fromElementString, getByteArray, getPropValue0, getValueClasses, initializeValue, modifyPropValue, toElementString, toNativeValue0, validatePropType
 - Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalsTree, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferences, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeElement, initializeGElement, initializeGProp, initializeProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropDispose, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onPropValueSet, onReferenceEvent, onRemoteEvent, onVirtualizationCompleted, onVirtualized, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verify, verifyHasPropertyItem, virtualize, warning, warning, warning
 
 
- Constructor Detail- PKCS12IdentityProp- protected PKCS12IdentityProp() Creates a byte array property with the specified name with a null value.
 - PKCS12IdentityProp- public PKCS12IdentityProp(Atom propertyAtom) Creates a byte array property with the specified name with a null value.- Parameters:
- propertyAtom- the property atom.
 
 
 - Method Detail- clone- public PKCS12IdentityProp clone() Clones the byte array property.- Overrides:
- clonein class- ByteArrayProp
- Returns:
- A new cloned ByteArrayProp.
 
 - setPropValue- public boolean setPropValue(byte[] newValue) Sets a new value for this property. If any listener is present and the value has changed compare to the last value, the listener is informed.- Overrides:
- setPropValuein class- ByteArrayProp
- Parameters:
- newValue- the new value.
- Returns:
- boolean true for value has changed, false for same value as current value.
 
 - setIdentity- public boolean setIdentity(java.lang.String fileName, char[] password) throws java.io.FileNotFoundException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.UnrecoverableKeyExceptionSets the identity.- Parameters:
- fileName- The file name of the keystore.
- password- The password.
- Returns:
- boolean true for value has changed, false for same value as current value.
- Throws:
- java.io.FileNotFoundException- If the file is not found.
- java.security.NoSuchAlgorithmException- If the algorithm used to check the integrity of the keystore cannot be found.
- java.security.cert.CertificateException- If any of the certificates in the keystore could not be loaded.
- java.io.IOException- If there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrect. If the error is due to a wrong password, the cause of the IOException should be an UnrecoverableKeyException.
- java.security.UnrecoverableKeyException- If the key cannot be recovered (e.g. the given password is wrong).
- java.security.KeyStoreException
 
 - getKeyManagers- public javax.net.ssl.KeyManager[] getKeyManagers(char[] password) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException, java.security.UnrecoverableKeyExceptionGets the Key Managers for the identity, a class representing a storage facility for cryptographic keys and certificates.- Parameters:
- password- The password of the identity.
- Returns:
- The Key Managers, or null if no identity is set.
- Throws:
- java.security.KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- java.security.NoSuchAlgorithmException- If the algorithm used to check the integrity of the keystore cannot be found.
- java.security.cert.CertificateException- If any of the certificates in the keystore could not be loaded.
- java.io.IOException- If there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrect. If the error is due to a wrong password, the cause of the IOException should be an UnrecoverableKeyException.
- java.security.UnrecoverableKeyException- If the key cannot be recovered (e.g. the given password is wrong).
 
 - getIdentityDescription- public java.lang.String getIdentityDescription() Gets the description of the identity.- Returns:
- The identity description string or null if no identity is set.
 
 - getKeyStore- public java.security.KeyStore getKeyStore(char[] password) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOExceptionGets the KeyStore for the identity.- Parameters:
- password- The password of the identity.
- Returns:
- The keystore, or null if identity is not set.
- Throws:
- java.security.KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- java.security.NoSuchAlgorithmException- If the algorithm used to check the integrity of the keystore cannot be found.
- java.security.cert.CertificateException- If any of the certificates in the keystore could not be loaded.
- java.io.IOException- If there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrect. If the error is due to a wrong password, the cause of the IOException should be an UnrecoverableKeyException.
 
 - setKeyStore- public void setKeyStore(java.security.KeyStore keyStore, char[] password, java.lang.String descr) throws java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateExceptionStores the keystore along with a description of it.- Parameters:
- keyStore- The keystore.
- password- The password.
- descr- Description of the keystore, cannot be null.
- Throws:
- java.io.IOException- For I/O errors.
- java.security.cert.CertificateException- If any of the certificates in the keystore could not be saved.
- java.security.NoSuchAlgorithmException- If the algorithm used to check the integrity of the keystore cannot be found.
- java.security.KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.