diff options
Diffstat (limited to 'rpkid/rpki/x509.py')
-rw-r--r-- | rpkid/rpki/x509.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/rpkid/rpki/x509.py b/rpkid/rpki/x509.py index 1cd01dca..67b07097 100644 --- a/rpkid/rpki/x509.py +++ b/rpkid/rpki/x509.py @@ -845,7 +845,7 @@ class PKCS10(DER_object): Class to hold a PKCS #10 request. """ - formats = ("DER", "POWpkix") + formats = ("DER", "POW", "POWpkix") pem_converter = PEM_converter("CERTIFICATE REQUEST") def get_DER(self): @@ -855,11 +855,22 @@ class PKCS10(DER_object): self.check() if self.DER: return self.DER + if self.POW: + self.DER = self.POW.derWrite() if self.POWpkix: self.DER = self.POWpkix.toString() return self.get_DER() raise rpki.exceptions.DERObjectConversionError, "No conversion path to DER available" + def get_POW(self): + """ + Get the rpki.POW value of this certification request. + """ + self.check() + if not self.POW: + self.POW = rpki.POW.PKCS10.derRead(self.get_DER()) + return self.POW + def get_POWpkix(self): """ Get the rpki.POW.pkix value of this certification request. |