/** * Implementation of the {@code engineToString} method. * * @return the string representation */ protected String engineToString() { return "AlgorithmParametersSpi for " + getParameterType(); } }
/** * Implementation of the {@code engineGetParameterSpec} method. * * @param type the parameter specification type class (must not be {@code null}) * @param <T> the parameter specification type * @return the parameter specification (must not be {@code null}) * @throws InvalidParameterSpecException if the type is not supported */ protected final <T extends AlgorithmParameterSpec> T engineGetParameterSpec(final Class<T> type) throws InvalidParameterSpecException { checkInit(); if (type.isAssignableFrom(getParameterType()) && type.isInstance(parameterSpec)) { return type.cast(parameterSpec); } else { throw log.invalidParameterSpec(getParameterType(), type); } }
/** * Implementation of the {@code engineInit} method. * * @param paramSpec the parameter specification * @throws InvalidParameterSpecException if an argument is invalid or encoding failed */ protected final void engineInit(final AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException { final Class<P> parameterType = getParameterType(); if (parameterType.isInstance(paramSpec)) try { DEREncoder encoder = new DEREncoder(); final P cast = parameterType.cast(paramSpec); engineEncode(encoder, cast); encoded = encoder.getEncoded(); this.parameterSpec = cast; } catch (ASN1Exception e) { throw log.failedToEncode(e); } else { throw log.invalidParameterSpec(parameterType, paramSpec.getClass()); } }
/** * Implementation of the {@code engineToString} method. * * @return the string representation */ protected String engineToString() { return "AlgorithmParametersSpi for " + getParameterType(); } }
/** * Implementation of the {@code engineToString} method. * * @return the string representation */ protected String engineToString() { return "AlgorithmParametersSpi for " + getParameterType(); } }
/** * Implementation of the {@code engineToString} method. * * @return the string representation */ protected String engineToString() { return "AlgorithmParametersSpi for " + getParameterType(); } }
/** * Implementation of the {@code engineGetParameterSpec} method. * * @param type the parameter specification type class (must not be {@code null}) * @param <T> the parameter specification type * @return the parameter specification (must not be {@code null}) * @throws InvalidParameterSpecException if the type is not supported */ protected final <T extends AlgorithmParameterSpec> T engineGetParameterSpec(final Class<T> type) throws InvalidParameterSpecException { checkInit(); if (type.isAssignableFrom(getParameterType()) && type.isInstance(parameterSpec)) { return type.cast(parameterSpec); } else { throw log.invalidParameterSpec(getParameterType(), type); } }
/** * Implementation of the {@code engineGetParameterSpec} method. * * @param type the parameter specification type class (must not be {@code null}) * @param <T> the parameter specification type * @return the parameter specification (must not be {@code null}) * @throws InvalidParameterSpecException if the type is not supported */ protected final <T extends AlgorithmParameterSpec> T engineGetParameterSpec(final Class<T> type) throws InvalidParameterSpecException { checkInit(); if (type.isAssignableFrom(getParameterType()) && type.isInstance(parameterSpec)) { return type.cast(parameterSpec); } else { throw log.invalidParameterSpec(getParameterType(), type); } }
/** * Implementation of the {@code engineGetParameterSpec} method. * * @param type the parameter specification type class (must not be {@code null}) * @param <T> the parameter specification type * @return the parameter specification (must not be {@code null}) * @throws InvalidParameterSpecException if the type is not supported */ protected final <T extends AlgorithmParameterSpec> T engineGetParameterSpec(final Class<T> type) throws InvalidParameterSpecException { checkInit(); if (type.isAssignableFrom(getParameterType()) && type.isInstance(parameterSpec)) { return type.cast(parameterSpec); } else { throw log.invalidParameterSpec(getParameterType(), type); } }
/** * Implementation of the {@code engineInit} method. * * @param paramSpec the parameter specification * @throws InvalidParameterSpecException if an argument is invalid or encoding failed */ protected final void engineInit(final AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException { final Class<P> parameterType = getParameterType(); if (parameterType.isInstance(paramSpec)) try { DEREncoder encoder = new DEREncoder(); final P cast = parameterType.cast(paramSpec); engineEncode(encoder, cast); encoded = encoder.getEncoded(); this.parameterSpec = cast; } catch (ASN1Exception e) { throw log.failedToEncode(e); } else { throw log.invalidParameterSpec(parameterType, paramSpec.getClass()); } }
/** * Implementation of the {@code engineInit} method. * * @param paramSpec the parameter specification * @throws InvalidParameterSpecException if an argument is invalid or encoding failed */ protected final void engineInit(final AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException { final Class<P> parameterType = getParameterType(); if (parameterType.isInstance(paramSpec)) try { DEREncoder encoder = new DEREncoder(); final P cast = parameterType.cast(paramSpec); engineEncode(encoder, cast); encoded = encoder.getEncoded(); this.parameterSpec = cast; } catch (ASN1Exception e) { throw log.failedToEncode(e); } else { throw log.invalidParameterSpec(parameterType, paramSpec.getClass()); } }
/** * Implementation of the {@code engineInit} method. * * @param paramSpec the parameter specification * @throws InvalidParameterSpecException if an argument is invalid or encoding failed */ protected final void engineInit(final AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException { final Class<P> parameterType = getParameterType(); if (parameterType.isInstance(paramSpec)) try { DEREncoder encoder = new DEREncoder(); final P cast = parameterType.cast(paramSpec); engineEncode(encoder, cast); encoded = encoder.getEncoded(); this.parameterSpec = cast; } catch (ASN1Exception e) { throw log.failedToEncode(e); } else { throw log.invalidParameterSpec(parameterType, paramSpec.getClass()); } }