Revert the revert. (its time to sign MR1)

Revert "Waiting till post MR0 - this impacts signing tools for MR0."

This reverts commit a7b5c4a7dc.

Bug: 11334314
Change-Id: I89f8996161e4258b80bf2d0bc7817f0e8e32df13
This commit is contained in:
Baligh Uddin
2013-11-13 00:22:34 +00:00
parent a7b5c4a7dc
commit beb6afdee2
3 changed files with 53 additions and 17 deletions

View File

@@ -954,3 +954,18 @@ def GetTypeAndDevice(mount_point, info):
return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
else:
return None
def ParseCertificate(data):
"""Parse a PEM-format certificate."""
cert = []
save = False
for line in data.split("\n"):
if "--END CERTIFICATE--" in line:
break
if save:
cert.append(line)
if "--BEGIN CERTIFICATE--" in line:
save = True
cert = "".join(cert).decode('base64')
return cert