Code example for DSAPublicKeySpec

0
 
                    p = params.getP();
                    q = params.getQ();
                    g = params.getG();
 
                    return (T) (new DSAPublicKeySpec(y, p, q, g));
                } 
 
                if (keySpec.equals(X509EncodedKeySpec.class)) {
                    return (T) (new X509EncodedKeySpec(key.getEncoded()));
                } 
 
                throw new InvalidKeySpecException(Messages
                        .getString("security.19D")); //$NON-NLS-1$ 
            } 
        } 
        throw new InvalidKeySpecException(Messages.getString("security.19F")); //$NON-NLS-1$
    } 
 
    /** 
     * The method generates a DSAPublicKey object from the provided key.