Java 8 SignatureMethod - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SignatureMethod class.

This code example shows how to use the following methods:getAlgorithm
String alias = ks.getCertificateAlias(xcert);
        if (alias != null) {
            PublicKey pk = ks.getCertificate(alias).getPublicKey();
            // make sure algorithm is compatible with method 
            if (algEquals(sm.getAlgorithm(), pk.getAlgorithm())) {
                return new SimpleKeySelectorResult(pk);
            } 
        } 
        return null; 
    } 
 
    /** 
     * Returns an OID of a public-key algorithm compatible with the specified 
     * signature algorithm URI. 
     * @param algURI The base uri of the algorithm the key was made with 
     * @return String A reference OID for the algorithim used to sign. 
     */ 
    private String getPKAlgorithmOID(String algURI) {
        if (algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) {
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getAlgorithm
	    boolean[] keyUsage = xc.getKeyUsage();
	    if (keyUsage[0]) {
		String alias = keyStore.getCertificateAlias(xc);
		if (alias != null) {
		    PublicKey pk = keyStore.getCertificate(alias).getPublicKey();
		    if (equals(sm.getAlgorithm(), pk.getAlgorithm())) {
			return new SimpleKeySelectorResult(pk);
		    } 
		} 
	    } 
	    throw new NoSuchElementException(xc.getSubjectX500Principal().toString());
	} 
 
	/** 
	 * Return the OID corresponding to the Algorithm URI. 
	 */ 
	String getOid(String uri) {
	    if (uri.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) {
		return "1.2.840.10040.4.1"; 
	    } else if (uri.equalsIgnoreCase(SignatureMethod.RSA_SHA1)) {
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 SignatureMethod Methods: