KeyManagerImpl implements KeyManager { @Override public String signPublicKey( String sourceIdentityId, String keyText, int trustLevel ) { String keyStr = ""; try { PGPPublicKeyRing targetPubRing = PGPKeyUtil.readPublicKeyRing( keyText ); PGPSecretKeyRing sourceSecRing = getSecretKeyRing( sourceIdentityId ); targetPubRing = signKey( sourceSecRing, targetPubRing, trustLevel ); keyStr = encryptionTool.armorByteArrayToString( targetPubRing.getEncoded() ); } catch ( Exception ex ) { LOG.error( "**** Error !!! Error signing key, IdentityId: " + sourceIdentityId, ex ); } return keyStr; } KeyManagerImpl( SecurityDataService securityDataService, KeyServer keyServer,
                           SecurityKeyData securityKeyData ); @Override String getPeerId(); @Override void setPeerOwnerId( String id ); @Override String getPeerOwnerId(); @Override PGPPublicKeyRing signKey( PGPSecretKeyRing sourceSecRing, PGPPublicKeyRing targetPubRing, int trustLevel ); @Override PGPPublicKeyRing signKey( String sourceFingerprint, String targetFingerprint, int trustLevel ); @Override String signPublicKey( String sourceIdentityId, String keyText, int trustLevel ); @Override PGPPublicKeyRing setKeyTrust( PGPSecretKeyRing sourceSecRing, PGPPublicKeyRing targetPubRing,
                                         int trustLevel ); @Override PGPPublicKeyRing setKeyTrust( String sourceFingerprint, String targetFingerprint, int trustLevel ); @Override boolean verifySignature( String sourceFingerprint, String targetFingerprint ); @Override boolean verifySignature( PGPPublicKeyRing sourcePubRing, PGPPublicKeyRing targetPubRing ); @Override PGPPublicKeyRing removeSignature( String sourceFingerprint, String targetFingerprint ); @Override PGPPublicKeyRing removeSignature( PGPPublicKey sourcePublicKey, PGPPublicKeyRing targetPubRing ); @Override SecurityKeyTrust getKeyTrustData( String sourceFingerprint, String targetFingerprint ); @Override List<SecurityKeyTrust> getKeyTrustData( final String sourceFingerprint ); @Override void removeKeyTrust( String sourceFingerprint ); @Override void removeKeyAllTrustData( String fingerprint ); @Override void removeKeyTrustData( String sourceFingerprint, String targetFingerprint ); @Override SecurityKeyTrust saveKeyTrustData( String sourceFingerprint, String targetFingerprint, int trustLevel ); @Override void saveSecretKeyRing( String identityId, int type, PGPSecretKeyRing secretKeyRing ); @Override void savePublicKeyRing( String identityId, int type, String keyringAsASCII ); @Override void savePublicKeyRing( String identityId, int type, PGPPublicKeyRing publicKeyRing ); @Override void removePublicKeyRing( String identityId ); @Override void removeSecretKeyRing( String identityId ); @Override SecurityKey getKeyData( String identityId ); @Override SecurityKey getKeyDataByFingerprint( String fingerprint ); @Override void removeKeyData( String identityId ); @Override PGPPublicKey getPublicKey( String identityId ); @Override PGPPublicKeyRing getPublicKeyRingByFingerprint( String fingerprint ); @Override String getPublicKeyRingAsASCII( String identityId ); @Override PGPPublicKeyRing getPublicKeyRing( String identityId ); @Override String getFingerprint( String identityId ); @Override PGPSecretKeyRing getSecretKeyRing( String identityId ); @Override InputStream getSecretKeyRingInputStream( String identityId ); @Override PGPSecretKey getSecretKey( String identityId ); @Override PGPPrivateKey getPrivateKey( String identityId ); @Override void updatePublicKeyRing( final PGPPublicKeyRing publicKeyRing ); @Override PGPSecretKey getSecretKeyByFingerprint( String fingerprint ); @Override PGPSecretKeyRing getSecretKeyRingByFingerprint( String fingerprint ); @Override KeyPair generateKeyPair( String identityId, boolean armored ); @Override void saveKeyPair( String identityId, int type, KeyPair keyPair ); @Override void removeKeyRings( String identityId ); @Override PGPPublicKey getRemoteHostPublicKey( PeerInfo peerInfo ); @Override PGPPublicKey getRemoteHostPublicKey( final String hostIdTarget ); @Override SecurityKey getKeyDetails( final String fingerprint ); @Override SecurityKey getKeyTrustTree( String identityId ); @Override int getTrustLevel( String sourceFingerprint, String targetFingerprint );  }
@Test public void testSignPublicKey() throws Exception { }