Code example for NoSuchProviderException

0
        if (provider != null)
        { 
            this.provider = Security.getProvider(provider);
            if (this.provider == null)
            { 
                throw new NoSuchProviderException("cannot find provider: " + provider);
            } 
        } 
    } 
 
    private PemObject createPemObject(Object o)
        throws IOException 
    { 
        String  type;
        byte[]  encoding;
 
        if (o instanceof PemObject)
        { 
            return (PemObject)o;
        } 
        if (o instanceof PemObjectGenerator)