Example #1
0
 def from_pem(klass, string):
     return klass.from_der(der.unpem(string))
Example #2
0
 def from_pem(klass, string):
     # the privkey pem file has two sections: "EC PARAMETERS" and "EC
     # PRIVATE KEY". The first is redundant.
     privkey_pem = string[string.index("-----BEGIN EC PRIVATE KEY-----"):]
     return klass.from_der(der.unpem(privkey_pem))