diff --git a/cert.go b/cert.go index 009908f..9295040 100644 --- a/cert.go +++ b/cert.go @@ -255,3 +255,33 @@ func (cm *certManager) displayCertInfoKeyPoints() [][2]string { return result } + +// getCertORG returns the organization name from the certificate. +// The organization name is typically included in the certificate's subject field. +func (cm *certManager) getCertORG() string { + return cm.certORG +} + +// getCertSERIAL returns the serial number from the certificate. +// The serial number is a unique identifier assigned by the certificate issuer. +func (cm *certManager) getCertSERIAL() string { + return cm.certSERIAL +} + +// isExpired returns whether the certificate is expired. +// This indicates if the certificate's validity period has ended. +func (cm *certManager) isExpired() bool { + return cm.expired +} + +// isExpiringSoon returns whether the certificate is expiring soon. +// This indicates if the certificate is approaching its expiration date. +func (cm *certManager) isExpiringSoon() bool { + return cm.expire_soon +} + +// daysUntilExpire returns the number of days until the certificate expires. +// This provides a countdown of days remaining before the certificate becomes invalid. +func (cm *certManager) daysUntilExpire() uint16 { + return cm.expire_days +} diff --git a/fiskalhr.go b/fiskalhr.go index 1b1e7df..9927720 100644 --- a/fiskalhr.go +++ b/fiskalhr.go @@ -195,6 +195,36 @@ func (fe *FiskalEntity) DisplayCertInfoKeyPoints() [][2]string { return fe.cert.displayCertInfoKeyPoints() } +// GetCertORG returns the organization name from the certificate. +// The organization name is typically included in the certificate's subject field. +func (fe *FiskalEntity) GetCertORG() string { + return fe.cert.certORG +} + +// GetCertSERIAL returns the serial number from the certificate. +// The serial number is a unique identifier assigned by the certificate issuer. +func (fe *FiskalEntity) GetCertSERIAL() string { + return fe.cert.certSERIAL +} + +// IsExpired returns whether the certificate is expired. +// This indicates if the certificate's validity period has ended. +func (fe *FiskalEntity) IsExpired() bool { + return fe.cert.expired +} + +// IsExpiringSoon returns whether the certificate is expiring soon. +// This indicates if the certificate is approaching its expiration date. +func (fe *FiskalEntity) IsExpiringSoon() bool { + return fe.cert.expire_soon +} + +// DaysUntilExpire returns the number of days until the certificate expires. +// This provides a countdown of days remaining before the certificate becomes invalid. +func (fe *FiskalEntity) DaysUntilExpire() uint16 { + return fe.cert.expire_days +} + // GenerateZKI generates the ZKI (Zaštitni Kod Izdavatelja) based on the given data. // The ZKI is a unique identifier for the invoice, generated by signing the concatenated // invoice data with the taxpayer's private key and hashing the signature.