@Test public void convert() throws Exception { List<CertificateInfo> certs = new ArrayList<>(); certs.add(new CertificateInfoBuilder().build()); List<CertRequestInfo> csrs = new ArrayList<>(); csrs.add(new CertRequestInfo("id", ClientId.create("a", "b", "c"), "sujbect-name")); KeyInfo info = new KeyInfo(true, KeyUsageInfo.SIGNING, "friendly-name", "id", "label", "public-key", certs, csrs, "sign-mechanism-name"); Key key = keyConverter.convert(info); assertEquals(true, key.getAvailable()); assertNotNull(key.getCertificates()); assertEquals(1, key.getCertificates().size()); assertNotNull(key.getCertificateSigningRequests()); assertEquals(1, key.getCertificateSigningRequests().size()); assertEquals("id", key.getId()); assertEquals("label", key.getLabel()); assertEquals("friendly-name", key.getName()); assertEquals(true, key.getSavedToConfiguration()); assertEquals(KeyUsageType.SIGNING, key.getUsage()); }
public Key convert(KeyInfo keyInfo) { return convertInternal(keyInfo, null); }
KeyConverter { public Key convert(KeyInfo keyInfo) { return convertInternal(keyInfo, null); } }
KeyConverter { public Key convert(KeyInfo keyInfo) { return convertInternal(keyInfo, null); } @Autowired  KeyConverter(TokenCertificateConverter tokenCertificateConverter,
            TokenCertificateSigningRequestConverter tokenCsrConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); }
KeyConverter { public Key convert(KeyInfo keyInfo) { return convertInternal(keyInfo, null); } @Autowired  KeyConverter(TokenCertificateConverter tokenCertificateConverter,
            TokenCertificateSigningRequestConverter tokenCsrConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); Key convert(KeyInfo keyInfo); Key convert(KeyInfo keyInfo, TokenInfo tokenInfo); List<Key> convert(Iterable<KeyInfo> keyInfos); List<Key> convert(Iterable<KeyInfo> keyInfos, TokenInfo tokenInfo); }
KeyConverter { public Key convert(KeyInfo keyInfo) { return convertInternal(keyInfo, null); } @Autowired  KeyConverter(TokenCertificateConverter tokenCertificateConverter,
            TokenCertificateSigningRequestConverter tokenCsrConverter,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            PossibleActionConverter possibleActionConverter); Key convert(KeyInfo keyInfo); Key convert(KeyInfo keyInfo, TokenInfo tokenInfo); List<Key> convert(Iterable<KeyInfo> keyInfos); List<Key> convert(Iterable<KeyInfo> keyInfos, TokenInfo tokenInfo);  }