|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.mediaserver.IDSpace
A space of globally unique IDs. Now with support for two ID schemes: '00' and '01'. Only '01' is generated; '00' can be verified, but is never generated.
'00' IDs contain some additional information, '01' IDs contain only an SHA-1 hash. Note that the data that produces the hash in the '00' IDs contains the part of the ID that is not part of the hash-- i.e., part of the ID is prepended to the actual data before hashing. '01' hashes do not do this. At first glance, this seems to be consistent, since there does not seem to be anything else in the '01' IDs except the hash-- but there is something else: the '01' ID format byte.
Yet, hashing that byte too would make the model harder to understand, and it's not like there would be much point in it. So there's a minor inconsistency between '00' and '01' IDs which you sometimes may have to worry about.
Field Summary | |
static IDSpace |
instance
|
Constructor Summary | |
IDSpace()
|
Method Summary | |
boolean |
checkData(Mediaserver.Id idid,
byte[] data)
Check that the hash code in the id is correct. |
java.io.InputStream |
checkInputStream(Mediaserver.Id idid,
java.io.InputStream is)
Return an ID-checking InputStream. |
Mediaserver.Id |
createID(byte[] data)
Create a fresh ID for the given block of data. |
void |
put00Data(java.security.MessageDigest d,
byte[] id,
byte[] data)
Put the data in an old-style ('00') id and data arrays into the signature object, preparing to sign the combination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final IDSpace instance
Constructor Detail |
public IDSpace()
Method Detail |
public void put00Data(java.security.MessageDigest d, byte[] id, byte[] data)
The old format is: 4 bytes = integer length of the id, the id and the data.
public Mediaserver.Id createID(byte[] data)
data
- The block of data that the new ID will refer topublic boolean checkData(Mediaserver.Id idid, byte[] data)
public java.io.InputStream checkInputStream(Mediaserver.Id idid, java.io.InputStream is)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |