public void addEnvironment(final String name, final String value) { ParamUtil.requireNonBlank("name", name); ParamUtil.requireNonBlank("value", value); this.environments.put(name, value); }
public long max(final String table, final String column, final String condition) throws DataAccessException { ParamUtil.requireNonBlank("table", table); ParamUtil.requireNonBlank("column", column); return datasource.getMax(connection, table, column, condition); }
public CaEntry(final NameId ident, final String signerType, final String signerConf, final int expirationPeriod) throws CaMgmtException { this.ident = ParamUtil.requireNonNull("ident", ident); this.signerType = ParamUtil.requireNonBlank("signerType", signerType); this.expirationPeriod = ParamUtil.requireMin("expirationPeriod", expirationPeriod, 0); this.signerConf = ParamUtil.requireNonBlank("signerConf", signerConf); }
protected void commit(final String task) throws DataAccessException { ParamUtil.requireNonBlank("task", task); try { connection.commit(); } catch (SQLException ex) { throw datasource.translate(task, ex); } }
public QaCertificatePolicyInformation policyInformation(final String policyId) { ParamUtil.requireNonBlank("policyId", policyId); for (QaCertificatePolicyInformation entry : policyInformations) { if (entry.policyId().equals(policyId)) { return entry; } } return null; }
public CsrEnrollCertRequest(final String id, final String certprofile, final CertificationRequest csr) { super(id); this.certprofile = ParamUtil.requireNonBlank("certprofile", certprofile); this.csr = ParamUtil.requireNonNull("csr", csr); }
protected PreparedStatement prepareStatement(final String sql) throws DataAccessException { ParamUtil.requireNonBlank("sql", sql); try { return connection.prepareStatement(sql); } catch (SQLException ex) { throw datasource.translate(sql, ex); } }
public SignerConf(final String conf) { this.hashAlgo = null; this.signatureAlgoControl = null; ParamUtil.requireNonBlank("conf", conf); this.confPairs = new ConfPairs(conf); if (getConfValue("algo") == null) { throw new IllegalArgumentException("conf must contain the entry 'algo'"); } }
public CertprofileInfo(final String name, final String type, final String conf) { this.name = ParamUtil.requireNonBlank("name", name).toUpperCase(); this.type = StringUtil.isBlank(type) ? null : type; this.conf = StringUtil.isBlank(conf) ? null : conf; }
public static X509CRL parseCrl(final String file) throws IOException, CertificateException, CRLException { ParamUtil.requireNonBlank("file", file); return parseCrl(new FileInputStream(IoUtil.expandFilepath(file))); }
public CertprofileEntry(final NameId ident, final String type, final String conf) { this.ident = ParamUtil.requireNonNull("ident", ident); this.type = ParamUtil.requireNonBlank("type", type); this.conf = conf; if ("ALL".equalsIgnoreCase(ident.name()) || "NULL".equalsIgnoreCase(ident.name())) { throw new IllegalArgumentException( "certificate profile name must not be 'ALL' and 'NULL'"); } }
public SignerConf(final String confWithoutAlgo, final HashAlgoType hashAlgo, final SignatureAlgoControl signatureAlgoControl) { ParamUtil.requireNonBlank("confWithoutAlgo", confWithoutAlgo); this.hashAlgo = ParamUtil.requireNonNull("hashAlgo", hashAlgo); this.signatureAlgoControl = signatureAlgoControl; this.confPairs = new ConfPairs(confWithoutAlgo); if (getConfValue("algo") != null) { throw new IllegalArgumentException("confWithoutAlgo must not contain the entry 'algo'"); } }
@Override public OcspStore newOcspStore(final String type) throws ObjectCreationException { ParamUtil.requireNonBlank("type", type); for (OcspStoreFactory service : services) { if (service.canCreateOcspStore(type)) { LOG.info("found factory to create OcspStore of type '" + type + "'"); return service.newOcspStore(type); } } throw new ObjectCreationException( "could not find factory to create OcspStore of type '" + type + "'"); }
public Asn1GenRSAKeypairParams(final P11SlotIdentifier slotId, final String label, final P11NewKeyControl control, final int keysize, final BigInteger publicExponent) { this.slotId = ParamUtil.requireNonNull("slotId", slotId); this.label = ParamUtil.requireNonBlank("label", label); this.control = ParamUtil.requireNonNull("control", control); this.keysize = ParamUtil.requireMin("keysize", keysize, 1); this.publicExponent = publicExponent; }
public Asn1GenECKeypairParams(final P11SlotIdentifier slotId, final String label, final P11NewKeyControl control, final ASN1ObjectIdentifier curveId) { this.slotId = ParamUtil.requireNonNull("slotId", slotId); this.label = ParamUtil.requireNonBlank("label", label); this.control = ParamUtil.requireNonNull("control", control); this.curveId = ParamUtil.requireNonNull("curveId", curveId); }
public Asn1CreateSecretKeyParams(final P11SlotIdentifier slotId, final String label, final P11NewKeyControl control, final long keyType, final byte[] keyValue) { this.slotId = ParamUtil.requireNonNull("slotId", slotId); this.label = ParamUtil.requireNonBlank("label", label); this.control = ParamUtil.requireNonNull("control", control); this.keyType = keyType; this.keyValue = ParamUtil.requireNonNull("keyValue", keyValue); }
public static SignerConf getKeystoreSignerConf(final String keystoreFile, final String password, final int parallelism, final HashAlgoType hashAlgo, final SignatureAlgoControl signatureAlgoControl) { ParamUtil.requireNonBlank("keystoreFile", keystoreFile); ParamUtil.requireNonBlank("password", password); ParamUtil.requireMin("parallelism", parallelism, 1); ParamUtil.requireNonNull("hashAlgo", hashAlgo); ConfPairs conf = new ConfPairs("password", password); conf.putPair("parallelism", Integer.toString(parallelism)); conf.putPair("keystore", "file:" + keystoreFile); return new SignerConf(conf.getEncoded(), hashAlgo, signatureAlgoControl); }
public static SignerConf getKeystoreSignerConf(final String keystoreFile, final String password, final HashAlgoType hashAlgo, final SignatureAlgoControl signatureAlgoControl) { ParamUtil.requireNonBlank("keystoreFile", keystoreFile); ParamUtil.requireNonBlank("password", password); ParamUtil.requireNonNull("hashAlgo", hashAlgo); ConfPairs conf = new ConfPairs("password", password); conf.putPair("parallelism", "1"); conf.putPair("keystore", "file:" + keystoreFile); return new SignerConf(conf.getEncoded(), hashAlgo, signatureAlgoControl); }
@Override public P11ObjectIdentifier createSecretKey(long keyType, byte[] keyValue, String label, P11NewKeyControl control) throws P11TokenException { ParamUtil.requireNonBlank("label", label); assertWritable("createSecretKey"); P11Identity identity = createSecretKey0(keyType, keyValue, label, control); addIdentity(identity); P11ObjectIdentifier objId = identity.identityId().objectId(); LOG.info("created secret key {}", objId); return objId; }
public Asn1GenDSAKeypairParams(final P11SlotIdentifier slotId, final String label, final P11NewKeyControl control, final BigInteger p, final BigInteger q, final BigInteger g) { // CHECKSTYLE:ON this.slotId = ParamUtil.requireNonNull("slotId", slotId); this.label = ParamUtil.requireNonBlank("label", label); this.control = ParamUtil.requireNonNull("control", control); this.p = ParamUtil.requireNonNull("p", p); this.q = ParamUtil.requireNonNull("q", q); this.g = ParamUtil.requireNonNull("g", g); }