当前位置: 首页>>代码示例>>Java>>正文


Java ECPublicKey.getW方法代码示例

本文整理汇总了Java中java.security.interfaces.ECPublicKey.getW方法的典型用法代码示例。如果您正苦于以下问题:Java ECPublicKey.getW方法的具体用法?Java ECPublicKey.getW怎么用?Java ECPublicKey.getW使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.interfaces.ECPublicKey的用法示例。


在下文中一共展示了ECPublicKey.getW方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractPublicKey

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
private static ECPoint extractPublicKey(final ECPublicKey ecPublicKey) {
    final java.security.spec.ECPoint publicPointW = ecPublicKey.getW();
    final BigInteger xCoord = publicPointW.getAffineX();
    final BigInteger yCoord = publicPointW.getAffineY();

    return CURVE.getCurve().createPoint(xCoord, yCoord);
}
 
开发者ID:toshiapp,项目名称:toshi-headless-client,代码行数:8,代码来源:ECKey.java

示例2: extractPublicKey

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
private static ECPoint extractPublicKey(final ECPublicKey ecPublicKey) {
  final java.security.spec.ECPoint publicPointW = ecPublicKey.getW();
  final BigInteger xCoord = publicPointW.getAffineX();
  final BigInteger yCoord = publicPointW.getAffineY();

  return CURVE.getCurve().createPoint(xCoord, yCoord);
}
 
开发者ID:talentchain,项目名称:talchain,代码行数:8,代码来源:ECKey.java

示例3: EC

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
EC(PublicKey key) throws KeyException {
    super(key);
    ECPublicKey ecKey = (ECPublicKey)key;
    ECPoint ecPoint = ecKey.getW();
    ecParams = ecKey.getParams();
    try {
        AccessController.doPrivileged(
            new PrivilegedExceptionAction<Void>() {
                public Void run() throws
                    ClassNotFoundException, NoSuchMethodException
                {
                    getMethods();
                    return null;
                }
            }
        );
    } catch (PrivilegedActionException pae) {
        throw new KeyException("ECKeyValue not supported",
                                pae.getException());
    }
    Object[] args = new Object[] { ecPoint, ecParams.getCurve() };
    try {
        ecPublicKey = (byte[])encodePoint.invoke(null, args);
    } catch (IllegalAccessException iae) {
        throw new KeyException(iae);
    } catch (InvocationTargetException ite) {
        throw new KeyException(ite);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:DOMKeyValue.java

示例4: EC

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
EC(PublicKey key) throws KeyException {
    super(key);
    ECPublicKey ecKey = (ECPublicKey)key;
    ECPoint ecPoint = ecKey.getW();
    ecParams = ecKey.getParams();
    ecPublicKey = encodePoint(ecPoint, ecParams.getCurve());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:DOMKeyValue.java

示例5: extractPublicKey

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
private static ECPoint extractPublicKey(ECPublicKey ecPublicKey) {
  java.security.spec.ECPoint publicPointW = ecPublicKey.getW();
  BigInteger xCoord = publicPointW.getAffineX();
  BigInteger yCoord = publicPointW.getAffineY();

  return CURVE.getCurve()
      .createPoint(xCoord, yCoord);
}
 
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:9,代码来源:ECKey.java

示例6: createSigner

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
public ConcurrentContentSigner createSigner(AlgorithmIdentifier signatureAlgId,
        int parallelism) throws XiSecurityException, P11TokenException {
    ParamUtil.requireMin("parallelism", parallelism, 1);

    List<XiContentSigner> signers = new ArrayList<>(parallelism);

    Boolean isSm2p256v1 = null;
    for (int i = 0; i < parallelism; i++) {
        XiContentSigner signer;
        if (publicKey instanceof RSAPublicKey) {
            if (i == 0 && !AlgorithmUtil.isRSASigAlgId(signatureAlgId)) {
                throw new XiSecurityException(
                        "the given algorithm is not a valid RSA signature algorithm '"
                        + signatureAlgId.getAlgorithm().getId() + "'");
            }
            signer = createRSAContentSigner(signatureAlgId);
        } else if (publicKey instanceof ECPublicKey) {
            ECPublicKey ecKey = (ECPublicKey) publicKey;

            if (i == 0) {
                isSm2p256v1 = GMUtil.isSm2primev2Curve(ecKey.getParams().getCurve());
                if (isSm2p256v1) {
                    if (!AlgorithmUtil.isSm2SigAlg(signatureAlgId)) {
                        throw new XiSecurityException(
                            "the given algorithm is not a valid SM2 signature algorithm '"
                            + signatureAlgId.getAlgorithm().getId() + "'");
                    }
                } else {
                    if (!AlgorithmUtil.isECSigAlg(signatureAlgId)) {
                        throw new XiSecurityException(
                            "the given algorithm is not a valid EC signature algorithm '"
                            + signatureAlgId.getAlgorithm().getId() + "'");
                    }
                }
            }

            if (isSm2p256v1) {
                java.security.spec.ECPoint w = ecKey.getW();
                signer = createSM2ContentSigner(signatureAlgId, GMObjectIdentifiers.sm2p256v1,
                        w.getAffineX(), w.getAffineY());
            } else {
                signer = createECContentSigner(signatureAlgId);
            }
        } else if (publicKey instanceof DSAPublicKey) {
            if (i == 0 && !AlgorithmUtil.isDSASigAlg(signatureAlgId)) {
                throw new XiSecurityException(
                        "the given algorithm is not a valid DSA signature algorithm '"
                        + signatureAlgId.getAlgorithm().getId() + "'");
            }
            signer = createDSAContentSigner(signatureAlgId);
        } else {
            throw new XiSecurityException("unsupported key " + publicKey.getClass().getName());
        }
        signers.add(signer);
    } // end for

    final boolean mac = false;
    PrivateKey privateKey = new P11PrivateKey(cryptService, identityId);
    DfltConcurrentContentSigner concurrentSigner;
    try {
        concurrentSigner = new DfltConcurrentContentSigner(mac, signers, privateKey);
    } catch (NoSuchAlgorithmException ex) {
        throw new XiSecurityException(ex.getMessage(), ex);
    }

    if (certificateChain != null) {
        concurrentSigner.setCertificateChain(certificateChain);
    } else {
        concurrentSigner.setPublicKey(publicKey);
    }

    return concurrentSigner;
}
 
开发者ID:xipki,项目名称:xitk,代码行数:74,代码来源:P11ContentSignerBuilder.java

示例7: ECDHClientKeyExchange

import java.security.interfaces.ECPublicKey; //导入方法依赖的package包/类
ECDHClientKeyExchange(PublicKey publicKey) {
    ECPublicKey ecKey = (ECPublicKey)publicKey;
    ECPoint point = ecKey.getW();
    ECParameterSpec params = ecKey.getParams();
    encodedPoint = JsseJce.encodePoint(point, params.getCurve());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:ECDHClientKeyExchange.java


注:本文中的java.security.interfaces.ECPublicKey.getW方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。