pub enum CertAdd {
Always = 4,
New = 1,
Newer = 6,
NewerInheritProperties = 7,
ReplaceExisting = 3,
ReplaceExistingInheritProperties = 5,
UseExisting = 2,
}
Expand description
Argument to the add_cert
function indicating how a certificate should be
added to a CertStore
.
Variants§
Always = 4
The function makes no check for an existing matching certificate or link to a matching certificate. A new certificate is always added to the store. This can lead to duplicates in a store.
New = 1
If a matching certificate or a link to a matching certificate exists, the operation fails.
Newer = 6
If a matching certificate or a link to a matching certificate exists and the NotBefore time of the existing context is equal to or greater than the NotBefore time of the new context being added, the operation fails.
If the NotBefore time of the existing context is less than the NotBefore time of the new context being added, the existing certificate or link is deleted and a new certificate is created and added to the store. If a matching certificate or a link to a matching certificate does not exist, a new link is added.
NewerInheritProperties = 7
If a matching certificate or a link to a matching certificate exists and the NotBefore time of the existing context is equal to or greater than the NotBefore time of the new context being added, the operation fails.
If the NotBefore time of the existing context is less than the NotBefore time of the new context being added, the existing context is deleted before creating and adding the new context. The new added context inherits properties from the existing certificate.
ReplaceExisting = 3
If a link to a matching certificate exists, that existing certificate or link is deleted and a new certificate is created and added to the store. If a matching certificate or a link to a matching certificate does not exist, a new link is added.
ReplaceExistingInheritProperties = 5
If a matching certificate exists in the store, the existing context is not replaced. The existing context inherits properties from the new certificate.
UseExisting = 2
If a matching certificate or a link to a matching certificate exists, that existing certificate or link is used and properties from the new certificate are added. The function does not fail, but it does not add a new context. The existing context is duplicated and returned.
If a matching certificate or a link to a matching certificate does not exist, a new certificate is added.