Source code: cryptix/jce/provider/pk/RSASignature_PKCS1_SHA256.java
1 /* $Id: RSASignature_PKCS1_SHA256.java,v 1.2 2001/11/18 02:35:22 gelderen Exp $
2 *
3 * Copyright (C) 2001 The Cryptix Foundation Limited.
4 * All rights reserved.
5 *
6 * Use, modification, copying and distribution of this software is subject
7 * the terms and conditions of the Cryptix General Licence. You should have
8 * received a copy of the Cryptix General Licence along with this library;
9 * if not, you can download a copy from http://www.cryptix.org/ .
10 */
11 package cryptix.jce.provider.pk;
12
13
14 /**
15 * A class to digest a message with SHA256, and sign/verify the
16 * resulting hash using the RSA digital signature scheme, with PKCS#1
17 * block padding.
18 *
19 * @version $Revision: 1.2 $
20 * @author Jeroen C. van Gelderen
21 */
22 public class RSASignature_PKCS1_SHA256 extends RSASignature_PKCS1 {
23
24 // Constants and variables
25 //...........................................................................
26
27 private static final byte[] SHA256_ASN_DATA = {
28 /* Taken from PKCS#1 1v2-1d1. */
29 0x30, 0x31, // SEQUENCE 49
30 0x30, 0x0d, // SEQUENCE 13
31 0x06, 0x09, 0x60, (byte)0x86, 0x48, 0x01, // OID
32 0x65, 0x03, 0x04, 0x02, 0x01,
33 0x05, 0x00, // NULL
34 0x04, 0x20 // OCTET STRING 32
35 };
36
37
38 // Constructor
39 //...........................................................................
40
41 public RSASignature_PKCS1_SHA256() { super("SHA-256"); }
42
43
44 // RSASignature_PKCS1 abstract method implementation
45 //...........................................................................
46
47 protected byte[] getAlgorithmEncoding() { return SHA256_ASN_DATA; }
48 }