Code example for ECPrivateKey

Methods: getParams, getS

0
       } 
       else if (spec.isAssignableFrom(java.security.spec.ECPrivateKeySpec.class) && key instanceof ECPrivateKey)
       { 
           ECPrivateKey k = (ECPrivateKey)key;
 
           if (k.getParams() != null)
           { 
               return new java.security.spec.ECPrivateKeySpec(k.getS(), k.getParams());
           } 
           else 
           { 
               ECParameterSpec implicitSpec = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
 
               return new java.security.spec.ECPrivateKeySpec(k.getS(), EC5Util.convertSpec(EC5Util.convertCurve(implicitSpec.getCurve(), implicitSpec.getSeed()), implicitSpec)); 
           } 
       } 
       else if (spec.isAssignableFrom(org.bouncycastle.jce.spec.ECPublicKeySpec.class) && key instanceof ECPublicKey)
       { 
           ECPublicKey k = (ECPublicKey)key;
           if (k.getParams() != null)
           { 
               return new org.bouncycastle.jce.spec.ECPublicKeySpec(EC5Util.convertPoint(k.getParams(), k.getW(), false), EC5Util.convertSpec(k.getParams(), false));
           } 
           else 
           { 
               ECParameterSpec implicitSpec = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
 
               return new org.bouncycastle.jce.spec.ECPublicKeySpec(EC5Util.convertPoint(k.getParams(), k.getW(), false), implicitSpec);
           } 
       } 
       else if (spec.isAssignableFrom(org.bouncycastle.jce.spec.ECPrivateKeySpec.class) && key instanceof ECPrivateKey)
       { 
           ECPrivateKey k = (ECPrivateKey)key;
 
           if (k.getParams() != null)
           { 
               return new org.bouncycastle.jce.spec.ECPrivateKeySpec(k.getS(), EC5Util.convertSpec(k.getParams(), false));
           } 
           else 
           { 
               ECParameterSpec implicitSpec = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
 
               return new org.bouncycastle.jce.spec.ECPrivateKeySpec(k.getS(), implicitSpec);
           } 
       } 
 
       return super.engineGetKeySpec(key, spec);
    }