| 308 | } |
| 309 | |
| 310 | size_t IdentityEx::ToBuffer (uint8_t * buf, size_t len) const |
| 311 | { |
| 312 | const size_t fullLen = GetFullLen(); |
| 313 | if (fullLen > len) return 0; // buffer is too small and may overflow somewhere else |
| 314 | memcpy (buf, &m_StandardIdentity, DEFAULT_IDENTITY_SIZE); |
| 315 | if (m_ExtendedLen > 0) |
| 316 | { |
| 317 | if (m_ExtendedLen > MAX_EXTENDED_BUFFER_SIZE) |
| 318 | memcpy (buf + DEFAULT_IDENTITY_SIZE, m_ExtendedBufferPtr, m_ExtendedLen); |
| 319 | else |
| 320 | memcpy (buf + DEFAULT_IDENTITY_SIZE, m_ExtendedBuffer, m_ExtendedLen); |
| 321 | } |
| 322 | return fullLen; |
| 323 | } |
| 324 | |
| 325 | size_t IdentityEx::FromBase64(std::string_view s) |
| 326 | { |
nothing calls this directly
no test coverage detected