Examples of KeyPair


Examples of com.jcraft.jsch.KeyPair

     * @throws Exception If a problem occurs.
     */
    private static String key() throws Exception {
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        try {
            final KeyPair kpair = KeyPair.genKeyPair(new JSch(), KeyPair.DSA);
            kpair.writePublicKey(stream, "");
            kpair.dispose();
        } finally {
            stream.close();
        }
        return new String(stream.toByteArray());
    }
View Full Code Here

Examples of com.kolich.havalo.entities.types.KeyPair

        // and access secret.  NOTE: Currently key pair identities
        // always associated with "normal" user roles.  The first
        // admin user is created via the Havalo bootstrap process on
        // first boot.  Only the first admin user has the rights
        // to call this specific API function.
        final KeyPair kp = new KeyPair();
        // Create a base repository for the new access key.  All of
        // the resources associated with this access key will sit
        // under this base repository (some directory on disk).
        createRepository(kp.getKey(), kp);
        return kp;
    }
View Full Code Here

Examples of com.linkedin.databus2.ggParser.XmlStateMachine.ColumnsState.KeyPair

      // Treat multiple keys as a separate case to avoid unnecessary casts
      Iterator<KeyPair> li = pairs.iterator();
      String compositeKey = "";
      while (li.hasNext())
      {
        KeyPair kp = li.next();
        Schema.Type pKeyType = kp.getKeyType();
        Object key = kp.getKey();
        if (pKeyType == Schema.Type.INT)
        {
          if (key instanceof Integer)
            compositeKey += kp.getKey().toString();
          else
            throw new DatabusException(
                "Schema.Type does not match actual key type (INT) "
                    + key.getClass().getName());
        }
View Full Code Here

Examples of com.linkedin.databus2.producers.ds.KeyPair

    {
      if (pkSchema.isPartOfPrimaryKey(field))
      {
        o = cl.get(cnt).getValue();
        st = field.schema().getType();
        KeyPair kp = new KeyPair(o, st);
        kpl.add(kp);
      }
      cnt++;
    }
View Full Code Here

Examples of com.woorea.openstack.nova.model.KeyPair

  public List list() {
    return new List();
  }

  public Create create(String name, String publicKey) {
    KeyPair keyPairForCreate = new KeyPair(name, publicKey);
    return new Create(keyPairForCreate);
  }
View Full Code Here

Examples of dust.crypto.Keypair

    System.arraycopy(entropy, 0, secret, 0, 32);

    Curve25519.keygen(pub, null, secret);

    return new Keypair(new Key(secret), new Key(pub));
  }
View Full Code Here

Examples of io.fathom.cloud.compute.api.os.model.Keypair

    public ListKeypairsResponse listKeypairs() throws CloudException {
        ListKeypairsResponse response = new ListKeypairsResponse();
        response.keypairs = Lists.newArrayList();

        for (KeyPairData data : keypairs.list(getProject())) {
            Keypair keypair = toModel(data);
            response.keypairs.add(keypair);
        }

        return response;
    }
View Full Code Here

Examples of java.security.KeyPair

  public byte[] createPublicKey() throws CryptoException {
    try {
      KeyPairGenerator keyGen = KeyPairGenerator.getInstance(ALGORITHM);
      keyGen.initialize(DH_SPEC);
      KeyPair keypair = keyGen.generateKeyPair();

      privateKey = keypair.getPrivate();
      PublicKey publicKey = keypair.getPublic();

      return publicKey.getEncoded();
    } catch (NoSuchAlgorithmException e) {
      throw new CryptoException(e);
    } catch (InvalidAlgorithmParameterException e) {
View Full Code Here

Examples of java.security.KeyPair

  {
    KeyPairGenerator  kg = KeyPairGenerator.getInstance( "RSA" );
   
    kg.initialize(strength, RandomUtils.SECURE_RANDOM );

    KeyPair pair = kg.generateKeyPair();
         
    X509V3CertificateGenerator certificateGenerator =
      new X509V3CertificateGenerator();
   
    certificateGenerator.setSignatureAlgorithm( "MD5WithRSAEncryption" );
   
    certificateGenerator.setSerialNumber( new BigInteger( ""+SystemTime.getCurrentTime()));
         
    X509Name  issuer_dn = new X509Name(true,cert_dn);
   
    certificateGenerator.setIssuerDN(issuer_dn);
   
    X509Name  subject_dn = new X509Name(true,cert_dn);
   
    certificateGenerator.setSubjectDN(subject_dn);
   
    Calendar  not_after = Calendar.getInstance();
   
    not_after.add(Calendar.YEAR, 1);
   
    certificateGenerator.setNotAfter( not_after.getTime());
   
    certificateGenerator.setNotBefore(Calendar.getInstance().getTime());
   
    certificateGenerator.setPublicKey( pair.getPublic());
   
    X509Certificate certificate = certificateGenerator.generateX509Certificate(pair.getPrivate());
   
    java.security.cert.Certificate[] certChain = {(java.security.cert.Certificate) certificate };

    manager.addCertToKeyStore( alias, pair.getPrivate(), certChain );
   
    return( certificate );
  }
View Full Code Here

Examples of java.security.KeyPair

            AsymmetricCipherKeyPair     pair = engine.generateKeyPair();
            ECPublicKeyParameters       pub = (ECPublicKeyParameters)pair.getPublic();
            ECPrivateKeyParameters      priv = (ECPrivateKeyParameters)pair.getPrivate();

            return new KeyPair(new JCEECPublicKey(algorithm, pub, ecParams),
                               new JCEECPrivateKey(algorithm, priv, ecParams));
        }
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.