Exemplo n.º 1
0
def toPemString(obj):
    return PemUtils.toPemString(obj)
Exemplo n.º 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)
Exemplo n.º 3
0
def fromPemFile(fileName):
    data = open(fullPath(fileName),"r").read()
    return PemUtils.fromPem(data)
Exemplo n.º 4
0
def toPemString(obj):
    return PemUtils.toPemString(obj)
Exemplo n.º 5
0
def fromPemFile(fileName):
    data = open(fullPath(fileName), "r").read()
    return PemUtils.fromPem(data)
Exemplo n.º 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")
Exemplo n.º 7
0
def fromPemStr(strIn):
    bytes = str2bytes(strIn)
    obj = PemUtils.fromPem(bytes)
    return obj