Examples of KeyType


Examples of net.schmizz.sshj.common.KeyType

            }

            final String hostnames = split[i++];
            final String sType = split[i++];

            KeyType type = KeyType.fromString(sType);
            PublicKey key;

            if (type != KeyType.UNKNOWN) {
                final String sKey = split[i++];
                key = getKey(sKey);
View Full Code Here

Examples of net.schmizz.sshj.common.KeyType

        this.console = console;
    }

    @Override
    protected boolean hostKeyUnverifiableAction(String hostname, PublicKey key) {
        final KeyType type = KeyType.fromKey(key);
        console.printf("The authenticity of host '%s' can't be established.\n" +
                               "%s key fingerprint is %s.\n", hostname, type, SecurityUtils.getFingerprint(key));
        String response = console.readLine("Are you sure you want to continue connecting (yes/no)? ");
        while (!(response.equalsIgnoreCase(YES) || response.equalsIgnoreCase(NO))) {
            response = console.readLine("Please explicitly enter yes/no: ");
View Full Code Here

Examples of net.schmizz.sshj.common.KeyType

        return false;
    }

    @Override
    protected boolean hostKeyChangedAction(HostEntry entry, String hostname, PublicKey key) {
        final KeyType type = KeyType.fromKey(key);
        final String fp = SecurityUtils.getFingerprint(key);
        final String path = getFile().getAbsolutePath();
        console.printf(
                "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n" +
                        "@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\n" +
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.KeyType

    sound.setEncodingType(EncodingType.BINARY);
    sound.setAudioMediaType(AudioMediaType.OGG);
    sound.setSoundURI(new File("test/images/smallTux.png").toURI());
    vcard.addSound(sound);
   
    KeyType key = new KeyType();
    key.setKeyTextType(KeyTextType.GPG);
    key.setEncodingType(EncodingType.BINARY);
    key.setCompression(false);
    byte[] keyBytes = Util.getFileAsBytes(new File("test/images/smallTux.png"));
    key.setKey(keyBytes);
    vcard.addKey(key);
   
    ExtendedType xGenerator = new ExtendedType("X-GENERATOR", "Cardme Generator");
    xGenerator.setCharset("UTF-8");
   
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.KeyType

 
  @Test
  public void testBuildKeyType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
   
    KeyType keyPlain = new KeyType();
    keyPlain.setKeyTextType(KeyTextType.PGP);
    keyPlain.setKey("plain text key");
    vcard.addKey(keyPlain);
   
    KeyType keyBin = new KeyType();
    keyBin.setKeyTextType(KeyTextType.X509);
    keyBin.setEncodingType(EncodingType.BINARY);
    keyBin.setKey("binary data".getBytes());
    vcard.addKey(keyBin);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.KeyType

    VCardImpl vcard = (VCardImpl)vCardEngine.parse(sb.toString());

    List<KeyType> list = vcard.getKeys();

    KeyType f = list.get(0);
    assertEquals(KeyTextType.PGP, f.getKeyTextType());
    assertArrayEquals("plain text key".getBytes(), f.getKey());
    assertEquals(EncodingType.EIGHT_BIT, f.getEncodingType());

    f = list.get(1);
    assertEquals(KeyTextType.GPG, f.getKeyTextType());
    assertArrayEquals("quoted printable\r\nkey".getBytes(), f.getKey());
    assertEquals(EncodingType.EIGHT_BIT, f.getEncodingType());

    f = list.get(2);
    assertEquals(KeyTextType.X509, f.getKeyTextType());
    assertArrayEquals(Base64Wrapper.decode("YmluYXJ5IGRhdGE="), f.getKey());
    assertEquals(EncodingType.BINARY, f.getEncodingType());
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.KeyType

   * @param vcard
   * @throws VCardParseException
   */
  private void parseKeyType(String group, String value, List<ParameterType> paramTypeList, VCardImpl vcard) throws VCardParseException {
    try {
      KeyType keyType = new KeyType();
      parseParamTypes(keyType, paramTypeList, value, VCardTypeName.KEY);
     
      if(keyType.isQuotedPrintable()) {
        value = decodeQuotedPrintableValue(keyType, value);
      }
     
      if(keyType.isBinary()) {
        byte[] keyBytes = Base64Wrapper.decode(value);
        keyType.setKey(keyBytes);
      }
      else {
        keyType.setKey(value);
      }
     
      if(group != null) {
        keyType.setGroup(group);
      }
     
      vcard.addKey(keyType);
    }
    catch(Exception ex) {
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.KeyType

  @Test
  public void testKey() throws VCardBuildException {
    VCardImpl vcard = new VCardImpl();
    appyBasicName(vcard);
   
    KeyType key = new KeyType("plain text key", KeyTextType.PGP);
    vcard.addKey(key);
    key = new KeyType("binary data".getBytes(), KeyTextType.X509);
    vcard.addKey(key);

    String result = getSerializedString(vcard);
    assertTrue(result.contains("KEY;TYPE=PGP:plain text key"));
    assertTrue(result.contains("KEY;ENCODING=B;TYPE=X509:YmluYXJ5IGRhdGE="));
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret.KeyType

      throws JSONException {
    String callbackUrl = consumerInfo.optString(CALLBACK_URL, null);
    String consumerSecret = consumerInfo.getString(CONSUMER_SECRET_KEY);
    String consumerKey = consumerInfo.getString(CONSUMER_KEY_KEY);
    String keyTypeStr = consumerInfo.getString(KEY_TYPE_KEY);
    KeyType keyType = KeyType.HMAC_SYMMETRIC;

    if (keyTypeStr.equals("RSA_PRIVATE")) {
      keyType = KeyType.RSA_PRIVATE;
      consumerSecret = convertFromOpenSsl(consumerSecret);
    }
View Full Code Here

Examples of org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret.KeyType

      throws JSONException {
    String callbackUrl = consumerInfo.optString(CALLBACK_URL, null);
    String consumerSecret = consumerInfo.getString(CONSUMER_SECRET_KEY);
    String consumerKey = consumerInfo.getString(CONSUMER_KEY_KEY);
    String keyTypeStr = consumerInfo.getString(KEY_TYPE_KEY);
    KeyType keyType = KeyType.HMAC_SYMMETRIC;

    if (keyTypeStr.equals("RSA_PRIVATE")) {
      keyType = KeyType.RSA_PRIVATE;
      consumerSecret = convertFromOpenSsl(consumerSecret);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.