📄 pkcs10requestmessage.java
字号:
if (index > 0) { ret = name.substring(0, index); } else { // Perhaps there is no space, only + index = name.indexOf('+'); if (index > 0) { ret = name.substring(0, index); } } } log.debug("UserName='" + ret + "'"); return ret; } /** * Gets the issuer DN if contained in the request (the CA the request is targeted at). * * @return issuerDN of receiving CA or null. */ public String getIssuerDN() { return null; } /** * Gets the number (of CA cert) from IssuerAndSerialNumber. Combined with getIssuerDN to identify * the CA-certificate of the CA the request is targeted for. * * @return serial number of CA certificate for CA issuing CRL or null. */ public BigInteger getSerialNo() { return null; } /** * Gets the issuer DN (of CA cert) from IssuerAndSerialNumber when this is a CRL request. * * @return issuerDN of CA issuing CRL. */ public String getCRLIssuerDN() { return null; } /** * Gets the number (of CA cert) from IssuerAndSerialNumber when this is a CRL request. * * @return serial number of CA certificate for CA issuing CRL. */ public BigInteger getCRLSerialNo() { return null; } /** * Returns the string representation of the subject DN from the certification request. * * @return subject DN from certification request or null. */ public String getRequestDN() { try { if (pkcs10 == null) { init(); } } catch (IllegalArgumentException e) { log.error("PKCS10 not inited!"); return null; } String ret = null; // Get subject name from request CertificationRequestInfo info = pkcs10.getCertificationRequestInfo(); if (info != null) { X509Name name = info.getSubject(); ret = name.toString(); } return ret; } public String getRequestAltNames() { return null; } /** * @see org.ejbca.core.protocol.IRequestMessage */ public Date getRequestValidityNotBefore() { return null; } /** * @see org.ejbca.core.protocol.IRequestMessage */ public Date getRequestValidityNotAfter() { return null; } /** * Gets the underlying BC <code>PKCS10CertificationRequest</code> object. * * @return the request object */ public PKCS10CertificationRequest getCertificationRequest() { try { if (pkcs10 == null) { init(); } } catch (IllegalArgumentException e) { log.error("PKCS10 not inited!"); return null; } return pkcs10; } /** * DOCUMENT ME! * * @return DOCUMENT ME! * * @throws InvalidKeyException DOCUMENT ME! * @throws NoSuchAlgorithmException DOCUMENT ME! * @throws NoSuchProviderException DOCUMENT ME! */ public boolean verify() throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException { return verify(null); } public boolean verify(PublicKey pubKey) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException { log.debug(">verify()"); boolean ret = false; try { if (pkcs10 == null) { init(); } if (pubKey == null) { ret = pkcs10.verify(); } else { ret = pkcs10.verify(pubKey, "BC"); } } catch (IllegalArgumentException e) { log.error("PKCS10 not inited!"); } catch (InvalidKeyException e) { log.error("Error in PKCS10-request:", e); throw e; } catch (SignatureException e) { log.error("Error in PKCS10-signature:", e); } log.debug("<verify()"); return ret; } /** * indicates if this message needs recipients public and private key to verify, decrypt etc. If * this returns true, setKeyInfo() should be called. * * @return True if public and private key is needed. */ public boolean requireKeyInfo() { return false; } /** * Sets the public and private key needed to decrypt/verify the message. Must be set if * requireKeyInfo() returns true. * * @param cert certificate containing the public key. * @param key private key. * @param provider the provider to use, if the private key is on a HSM you must use a special provider. If null is given, the default BC provider is used. * * @see #requireKeyInfo() */ public void setKeyInfo(X509Certificate cert, PrivateKey key, String Provider) { } /** * Returns an error number after an error has occured processing the request * * @return class specific error number */ public int getErrorNo() { return error; } /** * Returns an error message after an error has occured processing the request * * @return class specific error message */ public String getErrorText() { return errorText; } /** * Returns a senderNonce if present in the request * * @return senderNonce */ public String getSenderNonce() { return null; } /** * Returns a transaction identifier if present in the request * * @return transaction id */ public String getTransactionId() { return null; } /** * Returns requesters key info, key id or similar * * @return request key info */ public byte[] getRequestKeyInfo() { return null; } /** @see org.ejbca.core.protocol.IRequestMessage */ public String getPreferredDigestAlg() { return preferredDigestAlg; } /** @see org.ejbca.core.protocol.IRequestMessage */ public boolean includeCACert() { return includeCACert; } /** @see org.ejbca.core.protocol.IRequestMessage */ public int getRequestType() { return 0; } /** @see org.ejbca.core.protocol.IRequestMessage */ public int getRequestId() { return 0; } /** @see org.ejbca.core.protocol.IRequestMessage */ public IResponseMessage createResponseMessage(Class responseClass, IRequestMessage req, Certificate cert, PrivateKey signPriv, PrivateKey encPriv, String provider) { return RequestMessageUtils.createResponseMessage(responseClass, req, cert, signPriv, encPriv, provider); }} // PKCS10RequestMessage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -