List of usage examples for org.eclipse.jgit.transport PushCertificateParser fromString
public static PushCertificate fromString(String str) throws PackProtocolException, IOException
From source file:com.google.gerrit.gpg.api.GpgApiAdapterImpl.java
License:Apache License
@Override public PushCertificateInfo checkPushCertificate(String certStr, IdentifiedUser expectedUser) throws GpgException { try {// w w w . j a v a 2 s .com PushCertificate cert = PushCertificateParser.fromString(certStr); PushCertificateChecker.Result result = pushCertCheckerFactory.create(expectedUser).setCheckNonce(false) .check(cert); PushCertificateInfo info = new PushCertificateInfo(); info.certificate = certStr; info.key = GpgKeys.toJson(result.getPublicKey(), result.getCheckResult()); return info; } catch (IOException e) { throw new GpgException(e); } }