예제 #1
0
func assertKeysMissing(t *testing.T, gpgClient *libkb.GpgCLI, fingerprints []string) {
	for _, fingerprint := range fingerprints {
		_, err := gpgClient.ImportKey(false /*secret*/, *libkb.PGPFingerprintFromHexNoError(fingerprint))
		if err == nil {
			t.Fatal("Should not already have fingerprint in keyring:", fingerprint)
		}
	}
}
예제 #2
0
func assertKeysPresent(t *testing.T, gpgClient *libkb.GpgCLI, fingerprints []string) {
	for _, fingerprint := range fingerprints {
		fpObj, err := gpgClient.ImportKey(false /*secret*/, *libkb.PGPFingerprintFromHexNoError(fingerprint))
		if err != nil {
			t.Fatal("Should have fingerprint in keyring:", fingerprint)
		}
		if fingerprint != fpObj.GetFingerprint().String() {
			t.Fatal("Expected to import a different fingerprint:", fingerprint, fpObj.GetFingerprint())
		}
	}
}