def toPemString(obj): return PemUtils.toPemString(obj)
#!/usr/bin/env jython import org.openstack.atlas.util.ca.RSAKeyUtils as RSAKeyUtils import org.openstack.atlas.util.ca.PemUtils as PemUtils import org.openstack.atlas.util.ca.CsrUtils as CsrUtils import org.openstack.atlas.util.ca.CertUtils as CertUtils kp = RSAKeyUtils.genKeyPair(1024) x = RSAKeyUtils.toPKCS8(kp) out = PemUtils.toPemString(x)
def fromPemFile(fileName): data = open(fullPath(fileName),"r").read() return PemUtils.fromPem(data)
def fromPemFile(fileName): data = open(fullPath(fileName), "r").read() return PemUtils.fromPem(data)
def toPem(obj): if isinstance(obj,RsaPair): bytes = PemUtils.toPem(obj.toJavaSecurityKeyPair()) else: bytes = PemUtils.toPem(obj) return "%s"%String(bytes,"US-ASCII")
def fromPemStr(strIn): bytes = str2bytes(strIn) obj = PemUtils.fromPem(bytes) return obj