OPC Studio User's Guide and Reference
GetLifetimeInMonthsFrom Method (CertificateGenerationParameters)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security Namespace > CertificateGenerationParameters Class : GetLifetimeInMonthsFrom Method
The date from which to calculate the maximum lifetime.
Calculates the maximum lifetime of the generated certificate from the given date, in months.
Syntax
'Declaration
 
Public Function GetLifetimeInMonthsFrom( _
   ByVal fromDateTime As Date _
) As Integer
'Usage
 
Dim instance As CertificateGenerationParameters
Dim fromDateTime As Date
Dim value As Integer
 
value = instance.GetLifetimeInMonthsFrom(fromDateTime)
public int GetLifetimeInMonthsFrom( 
   DateTime fromDateTime
)
public:
int GetLifetimeInMonthsFrom( 
   DateTime fromDateTime
) 

Parameters

fromDateTime
The date from which to calculate the maximum lifetime.

Return Value

Number of months representing the lifetime of the certificate.
Remarks

The return value is the lower of number of months dictated by the MaximumExpirationDate and ValidityPeriodInMonths.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also