/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }
/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }
/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }
/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }
/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }
/** * Verifies a signed string and extracts the original string. * * @param signedStr the signed string to verify and extract. * * @return the extracted original string. * * @throws SignerException thrown if the given string is not a signed string or if the signature is invalid. */ public String verifyAndExtract(String signedStr) throws SignerException { int index = signedStr.lastIndexOf(SIGNATURE); if (index == -1) { throw new SignerException("Invalid signed text: " + signedStr); } String originalSignature = signedStr.substring(index + SIGNATURE.length()); String rawValue = signedStr.substring(0, index); checkSignatures(rawValue, originalSignature); return rawValue; }