Exemple #1
0
 def getPublicKey(self):
     """
     @return: {Tuple} (modulus, publicExponent)
     """
     log.debug("read RSA public key from proprietary certificate")
     #reverse because bignum in little endian
     return rsa.PublicKey(self.PublicKeyBlob.pubExp.value,
                          self.PublicKeyBlob.modulus.value[::-1])
Exemple #2
0
 def getPublicKey(self):
     """
     @return: {Tuple} (modulus, publicExponent)
     """
     log.debug("read RSA public key from x509 certificate")
     #last certifcate contain public key
     n, e = x509.extractRSAKey(
         x509.load(self.CertBlobArray[-1].abCert.value))
     return rsa.PublicKey(e, n)
Exemple #3
0
 def verify(self):
     """
     @summary: verify certificate signature
     """
     return rsa.verify(
         self.SignatureBlob.value[::-1],
         rsa.PublicKey(e=ProprietaryServerCertificate.
                       _TERMINAL_SERVICES_PUBLIC_EXPONENT_[::-1],
                       n=ProprietaryServerCertificate.
                       _TERMINAL_SERVICES_MODULUS_[::-1])
     )[::-1] == self.computeSignatureHash()