git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
935b862
)
added a function to return the public key string from a keypair object
author
Scott Baker
<bakers@cs.arizona.edu>
Thu, 23 Jul 2009 18:36:31 +0000
(18:36 +0000)
committer
Scott Baker
<bakers@cs.arizona.edu>
Thu, 23 Jul 2009 18:36:31 +0000
(18:36 +0000)
sfa/trust/certificate.py
patch
|
blob
|
history
diff --git
a/sfa/trust/certificate.py
b/sfa/trust/certificate.py
index
58486ec
..
4a17338
100644
(file)
--- a/
sfa/trust/certificate.py
+++ b/
sfa/trust/certificate.py
@@
-162,11
+162,21
@@
class Keypair:
def as_pem(self):
return crypto.dump_privatekey(crypto.FILETYPE_PEM, self.key)
def as_pem(self):
return crypto.dump_privatekey(crypto.FILETYPE_PEM, self.key)
+ ##
+ # Return an M2Crypto key object
+
def get_m2_pkey(self):
if not self.m2key:
self.m2key = M2Crypto.EVP.load_key_string(self.as_pem())
return self.m2key
def get_m2_pkey(self):
if not self.m2key:
self.m2key = M2Crypto.EVP.load_key_string(self.as_pem())
return self.m2key
+ ##
+ # Returns a string containing the public key represented by this object.
+
+ def get_pubkey_string(self):
+ m2pkey = self.get_m2_pkey()
+ return base64.b64encode(m2pkey.as_der())
+
##
# Return an OpenSSL pkey object
##
# Return an OpenSSL pkey object