-from sfa.util.namespace import *
-from sfa.trust.credential import *
-from sfa.trust.certificate import *
-from sfa.util.faults import *
-
-def get_credential(api, hrn, type, is_self=False):
+from sfa.util.xrn import Xrn, get_leaf, get_authority, hrn_to_urn, urn_to_hrn
+from sfa.util.plxrn import hrn_to_pl_login_base
+from sfa.trust.credential import Credential
+from sfa.trust.certificate import Certificate, Keypair
+from sfa.trust.gid import create_uuid
+
+def get_version(api):
+ version = {}
+ version['geni_api'] = 1
+ version['sfa'] = 1
+ return version
+
+def get_credential(api, xrn, type, is_self=False):
+ # convert xrn to hrn
+ if type:
+ hrn = urn_to_hrn(xrn)[0]
+ else:
+ hrn, type = urn_to_hrn(xrn)
+