Package com.iizix.server.acme
Class LetsEncryptDomain
- All Implemented Interfaces:
- EventListener,- IGProp<GProp<?>[]>,- IPropCnr,- Cloneable
- Direct Known Subclasses:
- EditorLetsEncryptDomain
Property container holding information about a Let's Encrypt domain with automatic certificate renewal in the server.
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe alias for the certificate.- static final StringFlag for auto-accept.- static final StringThe type of challenge: HTTP or DNS.- static final StringDefault password for keystore.- static final StringThe number of days before certificate expiration when a new certificate is requested from Let's Encrypt.- static final StringThe PKCS#12 identity password.- static final StringThe PKCS#12 identity.- static final StringThe URI of the Terms-of-Service for Let's Encrypt that must be accepted.- static final StringThe URI of the Terms-of-Service for Let's Encrypt that has been accepted.- Fields inherited from class com.iizix.prop.PropCnr- EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID- 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_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
- Constructor SummaryConstructorsConstructorDescriptionCreates the port configuration without a name.- LetsEncryptDomain- (Atom atom) Creates the port configuration with a name.
- Method SummaryModifier and TypeMethodDescription- booleanCalled to accept a Terms-of-Service agreement.- void- addConnectorReference- (PortConfig config) Adds a Jetty HTTP connector that references this domain.- clone()Creates a clone out of this property.Gets the type of challenge: HTTP or DNS.Gets the description of the port configuration.Gets the domain name.Gets the expiration date of the identities first certificate alias.- intGets the number of days before certificate expiration when a new certificate is requested from Let's Encrypt.Gets the KeyStore from a PKCS#12 identity property and password.- getKeyStore- (StringBuilder pwReturn) Gets the KeyStore from a PKCS#12 identity property and password.Gets the KeyStore password.Gets the Terms-of-Service agreement URI that needs to be accepted.Gets the certificate renewal instance.Gets the current Terms-of-Service agreement URI- booleanReturns the auto-accept Terms-of-Service agreement flag.- void- onEventSelf- (GEvent event) Change of password or keystore invalidates the existing keystore cached.- booleanGets the Terms-of-Service agreement URI that needs to be accepted.- void- startRenewal- (ServerShell server) Starts the renewal processing for the server.- boolean- updateIdentity- (File file, String password) Updates the PKCS#12 identity from a file.- Methods inherited from class com.iizix.prop.PropCnr- __transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, 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, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, 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, warning, warning, warning- Methods inherited from class java.lang.Object- getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.prop.IGProp- addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from interface com.iizix.prop.IPropCnr- canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
- Field Details- ID_PKCS12The PKCS#12 identity.- See Also:
 
- ID_PASSWORDThe PKCS#12 identity password.- See Also:
 
- EXPIRE_DAYSThe number of days before certificate expiration when a new certificate is requested from Let's Encrypt.- See Also:
 
- TOS_URIThe URI of the Terms-of-Service for Let's Encrypt that has been accepted.- See Also:
 
- TOS_ACCEPT_URIThe URI of the Terms-of-Service for Let's Encrypt that must be accepted.- See Also:
 
- AUTO_ACCEPTFlag for auto-accept.- See Also:
 
- ALIASThe alias for the certificate.- See Also:
 
- DEFAULT_PASSWORDDefault password for keystore.- See Also:
 
- CHALLENGE_TYPEThe type of challenge: HTTP or DNS.- See Also:
 
 
- Constructor Details- LetsEncryptDomainpublic LetsEncryptDomain()Creates the port configuration without a name. The name must be set in all cases using the- setPropertyAtomcall.
- LetsEncryptDomainCreates the port configuration with a name.- Parameters:
- atom- The name of the property.
 
 
- Method Details- cloneCreates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.
- onEventSelfChange of password or keystore invalidates the existing keystore cached.- Specified by:
- onEventSelfin interface- IGProp<GProp<?>[]>
- Overrides:
- onEventSelfin class- GProp<GProp<?>[]>
- Parameters:
- event- The property event.
 
- getKeyStorePasswordGets the KeyStore password.- Returns:
- The password, "changeit" for default.
 
- getKeyStorepublic KeyStore getKeyStore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOExceptionGets the KeyStore from a PKCS#12 identity property and password.- Returns:
- The configured KeyStore, or null if not defined.
- Throws:
- KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- NoSuchAlgorithmException- If the algorithm used to check the integrity of the KeyStore cannot be found.
- CertificateException- If any of the certificates in the KeyStore could not be loaded.
- 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.
 
- getKeyStorepublic KeyStore getKeyStore- (StringBuilder pwReturn) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException Gets the KeyStore from a PKCS#12 identity property and password.- Parameters:
- pwReturn- A StringBuilder instance that is filled with the password, null for none.
- Returns:
- The configured KeyStore, or null if not defined.
- Throws:
- KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- NoSuchAlgorithmException- If the algorithm used to check the integrity of the KeyStore cannot be found.
- CertificateException- If any of the certificates in the KeyStore could not be loaded.
- 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.
 
- updateIdentitypublic boolean updateIdentity- (File file, String password) throws UnrecoverableKeyException, FileNotFoundException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, PropException Updates the PKCS#12 identity from a file.- Parameters:
- file- The identity file.
- password- The password, null for default "changeit".
- Returns:
- true for changed, false for no change.
- Throws:
- FileNotFoundException- If the file is not found.
- NoSuchAlgorithmException- If the algorithm used to check the integrity of the keystore cannot be found.
- CertificateException- If any of the certificates in the keystore could not be loaded.
- 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.
- UnrecoverableKeyException- If the key cannot be recovered (e.g. the given password is wrong).
- KeyStoreException
- PropException
 
- getExpirationDayCountpublic int getExpirationDayCount()Gets the number of days before certificate expiration when a new certificate is requested from Let's Encrypt.- Returns:
- The number of days in the range 1 to 89, default 7.
 
- getExpirationDateGets the expiration date of the identities first certificate alias.- Returns:
- The date of expiry, or null if identity is not set or failed to load.
 
- getDomainGets the domain name.- Returns:
- The domain name as e.g. "hello.example.com".
 
- getDescriptionGets the description of the port configuration.- Returns:
- The description, or null for none.
 
- getChallengeTypeGets the type of challenge: HTTP or DNS.- Returns:
- The challenge type, default is LetsEncrypt.Type.HTTP.
 
- getTermsOfServiceURIGets the current Terms-of-Service agreement URI- Returns:
- The ToS URI, or null if not received yet.
 
- isAutoAcceptTermsOfServiceEnabledpublic boolean isAutoAcceptTermsOfServiceEnabled()Returns the auto-accept Terms-of-Service agreement flag.- Returns:
- true for auto-acceptance, false for manual acceptance.
 
- acceptTermsOfServiceCalled to accept a Terms-of-Service agreement.- Parameters:
- uri- The ToS URI.
- Returns:
- true if changed, false for no change.
- Throws:
- NullPointerException- If- uriis null.
 
- getNeedToAcceptTermsOfServiceURIGets the Terms-of-Service agreement URI that needs to be accepted.- Returns:
- The URI, or null for none.
 
- setNeedToAcceptTermsOfServiceURIGets the Terms-of-Service agreement URI that needs to be accepted.- Parameters:
- uri- The URI, never null.
- Returns:
- true if changed, false for no change.
- Throws:
- NullPointerException- If- uriis null.
 
- startRenewalStarts the renewal processing for the server.- Parameters:
- server- The server.
 
- getRenewalInstanceGets the certificate renewal instance.- Returns:
- The renewal instance, or nullif not started.
 
- addConnectorReferenceAdds a Jetty HTTP connector that references this domain.- Parameters:
- config- The port configuration.