예제 #1
0
def toPemString(obj):
    return PemUtils.toPemString(obj)
예제 #2
0
#!/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)
예제 #3
0
def fromPemFile(fileName):
    data = open(fullPath(fileName),"r").read()
    return PemUtils.fromPem(data)
예제 #4
0
def toPemString(obj):
    return PemUtils.toPemString(obj)
예제 #5
0
def fromPemFile(fileName):
    data = open(fullPath(fileName), "r").read()
    return PemUtils.fromPem(data)
예제 #6
0
def toPem(obj):
    if isinstance(obj,RsaPair):
        bytes = PemUtils.toPem(obj.toJavaSecurityKeyPair())
    else:
        bytes = PemUtils.toPem(obj)
    return "%s"%String(bytes,"US-ASCII")
예제 #7
0
def fromPemStr(strIn):
    bytes = str2bytes(strIn)
    obj = PemUtils.fromPem(bytes)
    return obj