private static byte[] decodeBase64Digest(String base64Digest) {
        String expectedPrefix = "sha1-";
        if (!base64Digest.startsWith(expectedPrefix)) {
            throw new IllegalArgumentException(base64Digest + " did not start with " +
                    expectedPrefix);
        }
        base64Digest = base64Digest.replaceFirst(expectedPrefix, "");
        byte[] bytes = new byte[0];
        try {
            bytes = Base64.decode(base64Digest);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
        return bytes;
    }
private static byte [ ] decodeBase64Digest ( String base64Digest ) { String expectedPrefix = "sha1-" ; if ( ! base64Digest . startsWith ( expectedPrefix ) ) { throw new IllegalArgumentException ( base64Digest + " did not start with " + expectedPrefix ) ; } base64Digest = base64Digest . replaceFirst ( expectedPrefix , "" ) ; byte [ ] bytes = new byte [ 0 ] ; try { bytes = Base64 . decode ( base64Digest ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( e ) ; } return bytes ; }
Decode base64'd getDigest into a byte array that is suitable for use
as a blob key.

@param base64Digest string with base64'd getDigest, with leading "sha1-" attached.
eg, "sha1-LKJ32423JK..."
@return a byte[] blob key